Manual doctrine completo espanol

Page 175

Doctrine 2 ORM Documentation, Release 2.1

you could have the following code in an entity repository: <?php class ArticleRepository extends EntityRepository { public function getVisibleByCategory(Category $category) { $dql = "SELECT a FROM Article a WHERE a.category = ?1 and a.visible = true"; return $this->getEntityManager() ->createQuery($dql) ->setParameter(1, $category) ->getResult(); } }

Cascade Merge with Bi-directional Associations There are two bugs now that concern the use of cascade merge in combination with bi-directional associations. Make sure to study the behavior of cascade merge if you are using it: DDC-875 Merge can sometimes add the same entity twice into a collection DDC-763 Cascade merge on associated entities can insert too many rows through “Persistence by Reachability” Custom Persisters A Persister in Doctrine is an object that is responsible for the hydration and write operations of an entity against the database. Currently there is no way to overwrite the persister implementation for a given entity, however there are several use-cases that can benefit from custom persister implementations: Add Upsert Support Evaluate possible ways in which stored-procedures can be used The previous Filter Rules Feature Request Persist Keys of Collections PHP Arrays are ordered hash-maps and so should be the Doctrine\Common\Collections\Collection interface. We plan to evaluate a feature that optionally persists and hydrates the keys of a Collection instance. Ticket DDC-213 Mapping many tables to one entity It is not possible to map several equally looking tables onto one entity. For example if you have a production and an archive table of a certain business concept then you cannot have both tables map to the same entity. Behaviors Doctrine 2 will never include a behavior system like Doctrine 1 in the core library. We don’t think behaviors add more value than they cost pain and debugging hell. Please see the many different blog posts we have written on this topics: Doctrine2 “Behaviors” in a Nutshell A re-usable Versionable behavior for Doctrine2 1.27. Limitations and Known Issues

171


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.