1.) find() is only for finding by identifier now
$article = $dm->find('Article', array('title' => 'test'))
to
$article = $dm->getRepository('Article')->findBy(array('title' => 'test'));
2.) Query builder change:
| <?php | |
| namespace Hydrators; | |
| use Doctrine\ODM\MongoDB\DocumentManager; | |
| use Doctrine\ODM\MongoDB\Mapping\ClassMetadata; | |
| use Doctrine\ODM\MongoDB\Hydrator\HydratorInterface; | |
| use Doctrine\ODM\MongoDB\UnitOfWork; | |
| /** |
1.) find() is only for finding by identifier now
$article = $dm->find('Article', array('title' => 'test'))
to
$article = $dm->getRepository('Article')->findBy(array('title' => 'test'));
2.) Query builder change:
| FROM: Harvey Ball <[email protected]> | |
| ------------------------------------- | |
| Hi, | |
| Why does doctrine piss memory up the wall like a drunken slag on a saturday night? | |
| I built a basic test such as.... | |
| Sku table |
| <?php | |
| /** @Document @HasLifecycleCallbacks */ | |
| class Product | |
| { | |
| /** @Id */ | |
| public $id; | |
| /** @String */ | |
| public $name; |
| class LockMode | |
| { | |
| const NONE = 0; | |
| const OPTIMISTIC = 1; | |
| const PESSIMISTIC_READ = 2; | |
| const PESSIMISTIC_WRITE = 4; | |
| final private function __construct() { } | |
| } |
| <?php | |
| /** @Document */ | |
| class Article | |
| { | |
| /** @Id */ | |
| public $id; | |
| /** @String */ | |
| public $title; |
| <form action="/symfony2-test/web/index_dev.php/" method="post"> <table> | |
| <tr> | |
| <td><label for="invoice_property1">Property1</label></td> | |
| <td> | |
| <input id="invoice_property1" name="invoice[property1]" value="" type="text" /> | |
| </td></tr> | |
| <tr> | |
| <td><label for="invoice_property2">Property2</label></td> | |
| <td> | |
| <input id="invoice_property2" name="invoice[property2]" value="" type="text" /> |
| <?php | |
| namespace Application\FrontendBundle\Controller; | |
| use Symfony\Bundle\FrameworkBundle\Controller; | |
| use Symfony\Components\Form; | |
| class MainController extends Controller | |
| { | |
| public function indexAction() |
| <?php | |
| $path = '/path/to/doctrine/mongodb-odm'; | |
| require_once $path.'/lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php'; | |
| use Doctrine\Common\ClassLoader, | |
| Doctrine\Common\Annotations\AnnotationReader, | |
| Doctrine\ODM\MongoDB\DocumentManager, | |
| Doctrine\ODM\MongoDB\Configuration, | |
| Doctrine\ODM\MongoDB\Mongo, |
| diff --git a/lib/Doctrine/ODM/MongoDB/DocumentManager.php b/lib/Doctrine/ODM/MongoDB/DocumentManager.php | |
| index 1b4fc2c..944d6e7 100644 | |
| --- a/lib/Doctrine/ODM/MongoDB/DocumentManager.php | |
| +++ b/lib/Doctrine/ODM/MongoDB/DocumentManager.php | |
| @@ -426,12 +426,11 @@ class DocumentManager | |
| * | |
| * @param string $documentName The document name to load. | |
| * @param string $id The id the document to load. | |
| - * @param boolean $isProxy | |
| * @return object $document The loaded document. |