### [DDC-3272] EntityGenerator writes 'MappedSuperClass' instead of 'MappedSuperclass' Created: 26/Aug/14  Updated: 26/Aug/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.4.4
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Blocker Reporter: Jakab Adam Balazs Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: mappedsuperclass, orm, tools Environment: not relevant

 Description
 In file doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php, method: generateEntityDocBlock at line: 826, we have $lines[] = ' * @' .$this->annotationsPrefix . 'MappedSuperClass'; but we do NOT have an annotation in Doctrine\ORM\Mapping called 'MappedSuperClass' but ''MappedSuperclass''. (Notice the lowercase "c"!). When using the generator, this generates the mapped superclass with wrong annotation resulting in  AnnotationException ::semanticalError ('The annotation "@Doctrine\ORM\Mapping\MappedSuperClass" in class Jab\Bundle\PlatformBundle\Entity\JabEntity does not exist, or could not be auto-loaded.') in /home/data/WWW/localServer/test.bradipo/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php at line 706

### [DDC-3062] [GH-997] [FIX] Allow to use ManyToMany with all operators Created: 31/Mar/14  Updated: 08/Jul/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5
Security Level: All

 Type: Bug Priority: Critical Reporter: Doctrine Bot Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of bakura10: Message: Hi, ping @guillhermoblanco : I think this may be blocking for 2.5 I introduced not so long ago support for ManyToMany for Criteria. However, I realized my implementation was really incomplete, because I hard-coded the "=" operator (https://github.com/doctrine/doctrine2/pull/885/files#diff-982b7374bbe9d5f4b6b71f4869a446eaR575). This means that it fails in a lot of cases when you use something different than "eq" for Criteria. This PR fixes that, however it's a bit hacky. The SqlExpressionVisitor was made by type hinting for a BasicEntityPersister, preventing us from using us for a collection persister. Therefore I added a new interface to keep BC. There is also a lot of code duplication (the whole "getSelectConditionSQL" was copied from the BasicEntityPersister), but without trait or BC, I have no idea about how to solve it. All tests pass, test were added for other operators.

### [DDC-3212] Remove ArrayHydrator logic Created: 14/Jul/14  Updated: 14/Jul/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.5
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Critical Reporter: Marco Pivetta Assignee: Marco Pivetta Resolution: Unresolved Votes: 0 Labels: hydration, hydrator

 Description
 The Doctrine\ORM\Internal\Hydration\ArrayHydrator ( https://github.com/doctrine/doctrine2/blob/85fbf684363b932a4ebaf543ef059f9ee1e512b0/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php ) is currently very messy and complicated due to the lack of actual Doctrine\ORM\UnitOfWork references when working with it, since we are not dealing with objects. In order to reduce the amount of bugs and code duplication when working with array hydration, I would simply suggest making use of the Doctrine\ORM\Internal\Hydration\ObjectHydrator ( https://github.com/doctrine/doctrine2/blob/85fbf684363b932a4ebaf543ef059f9ee1e512b0/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php ) and its siblings, and then extracting data coming from the results in it as an array. This could be a simple reflection-based extraction (pseudo): class ArrayHydrator { public function hydrateAllData() { foreach ($this->objectHydrator->hydrateAllData() as$object) { yield $this->extractData($object); } } }  The point here is that array-based hydration is not the primary focus of the ORM, and users should probably rely on SQL only when they want array hydration.

 Comment by Marco Pivetta [ 14/Jul/14 ] Note: performance is one of our biggest requirements, and array hydration is meant to achieve that. As I stated above, plain SQL is probably better for this sort of operation, so the issue is more about deprecating the ArrayHydrator completely, providing utilities to manipulate SQL resultsets instead.

### [DDC-3222] PostUpdate event destroying collectionUpdates Created: 21/Jul/14  Updated: 21/Jul/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.4.2
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Critical Reporter: Jacob Spizziri Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None Environment: Mac OSX, AMP, php 5.3.27

 Description
 I have an entity that contains a Many-To-Many Unidirectional association. When the association is updated and the entity is flushed the changes are not being persisted to the database. This is because the postUpdate event is being fired on executeUpdates, which is being called before the collection updates are being processed here:  // Collection updates (deleteRows, updateRows, insertRows) foreach ($this->collectionUpdates as$collectionToUpdate) { $this->getCollectionPersister($collectionToUpdate->getMapping())->update($collectionToUpdate); }  This is occurring in UnitOfWork->commit() lines 333 through 366. Apparently the postUpdate listener I wrote was causing the collectionUpdates property to be erased.  Comments  Comment by Marco Pivetta [ 21/Jul/14 ] What does the listener actually do? Doesn't look like a bug to me... Comment by Jacob Spizziri [ 21/Jul/14 ] I'm using FOSElasticaBundle/ElasticSearch. On the postUpdate event I'm calling fos:elastica:populate on the entity indexes. Heres the code container =$container; $this->logger =$logger; } public function postUpdate(LifecycleEventArgs $args){$this->index($args); } protected function index($args){ $entity =$args->getEntity(); $arguments = false;$command = new \FOS\ElasticaBundle\Command\PopulateCommand(); $command->setContainer($this->container); //TODO: probably need to specify the --env=prod/dev // update Elastica on Product update if ($entity instanceof Product) {$this->logger->info('Updating Product Search Indexes'); $arguments = array( '--index'=>'website', '--type' => 'product' ); } else if ($entity instanceof User) { $this->logger->info('Updating User Search Indexes');$arguments = array( '--index'=>'website', '--type' => 'user' ); } if($command &&$arguments){ $input = new ArrayInput($arguments); $output = new NullOutput();$result = $command->run($input, $output);$this->logger->info('Finished Updating Search Indexes with result: '. strval($result)); } } } ?>  Am I using this event incorrectly? Should I only be using postPersist? ### [DDC-3224] getResult(HYDRATE_OBJECT) with joined query is returning reduced number of rows Created: 23/Jul/14 Updated: 23/Jul/14 Status: Open Project: Doctrine 2 - ORM Component/s: ORM Affects Version/s: 2.4.2 Fix Version/s: None Security Level: All  Type: Bug Priority: Critical Reporter: gondo Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: orm Environment: osx, PHP-FPM 5.5.13, nginx/1.6.0, mysql 5.6.19 Homebrew  Description given that i have these 2 entities (pseodocode): /** * @ORM\Table(name="entity1", options={"collate"="utf8_unicode_ci", "charset"="utf8"}) * @ORM\Entity(repositoryClass="Entity1Repository") */ class Entity1 { /** * @var integer * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ protected$id;

/**
* @var string
* @ORM\Column(name="name", type="string")
*/
protected $name; /** * @var Entity2[] * @ORM\OneToMany(targetEntity="Entity2", mappedBy="entity1") */ protected$entity2;
}

/**
* @ORM\Table(name="entity2", options={"collate"="utf8_unicode_ci", "charset"="utf8"})
* @ORM\Entity()
*/
class Entity2 {
/**
* @var integer
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id; /** * @var \DateTime * @ORM\Column(name="date", type="datetime") */ protected$date;

/**
* @var Entity1
* @ORM\ManyToOne(targetEntity="Entity1", inversedBy="entity2", fetch="EAGER")
*/
protected $entity1; }  ## tables and data entity1: id name 1 Jhon 2 Clare entity2: id date entity1_id 1 2011-01-01 00:00:01 1 2 2012-02-02 00:00:02 1 3 2013-03-03 00:00:03 2 4 2014-04-04 00:00:04 2 ## my query builder use Doctrine\ORM\EntityRepository; class Entity1Repository extends EntityRepository { public function getData() {$qb = $this ->createQueryBuilder('Entity1') ->select('Entity1, Entity2.date') ->join('Entity1.entity2', 'Entity2', Join::WITH, 'Entity2.date > :date') ->setParameter('date', '2000-01-01 00:00:01') ;$result1 = $qb->getQuery()->getArrayResult(); // HYDRATE_ARRAY$result = $qb->getQuery()->getResult(); // HYDRATE_OBJECT // return$result1;

### [DDC-3083] Persist/Flush silently fails when CTI is applied on an existing table Created: 12/Apr/14  Updated: 13/Apr/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.4.2
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Frank Liepert Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 Given an existing table (= parent table) the integration of a new parent-child relationship with Class Table Inheritance (CTI) leads to a update problem. First of all a child table is created with a foreign key to the parent table. Next, the discriminator column is added to the parent table. The discriminator map will be auto-generated. The problem arises when trying to perform persist() and flush() on a child entity. Initially the child table is logically empty. However, the UnitOfWork triggers updateTable() which will fail since there is nothing to update. Instead, an upsert should be performed. Another sneaky thing is that the repository will return the child class with the updated data after calling flush() on the same request. On the next request the child class is returned with the data loaded from the persister. Of course, the updated data is missing.

 Comment by Marco Pivetta [ 13/Apr/14 ] Frank Liepert do I understand this correctly if I say that you are trying to (pseudo) upcast an entity to a more specific subtype? That is unsupported by the ORM. Could you make just an example snippet of what you described in the issue? Comment by Frank Liepert [ 13/Apr/14 ] Marco Pivetta: You have understood really well. If you say that's not supported by the ORM then this is the answer. Still I think that upsert could solve solve the "problem" and I know that there are/have been discussions about upsert. Right now I will continue to manually insert the missing rows in the child table. After this necessary step the ORM works as expected. Nevertheless the real bug is that after persist() and flush() the entity manager returns the child object with the "persisted" data of the child table although there are in fact no rows in the child table. $parentRepository =$em->getRepository('Parent'); $child =$parentRepository ->find(1); $child->setChildPropertyA('foo');$em->persist($child);$em->flush(); $child =$parentRepository ->find(1); var_dump($child->getChildPropertyA()); // string(3) "foo" // But: There is no 'foo' in the child table! /** * NEW REQUEST */$parentRepository = $em->getRepository('Parent');$child = $parentRepository ->find(1); var_dump($child->getChildPropertyA()); // NULL  Comment by Marco Pivetta [ 13/Apr/14 ] Frank Liepert why are $child in the first request and$child in the second request different here? Are you manually changing the data at SQL level? Comment by Frank Liepert [ 13/Apr/14 ] Marco Pivetta as I have explained the persist() and flush() in the first request trigger an UPDATE command (Because there is already a row in the parent table?). Given that the child table was manually created before there are no rows on that table at that time and therefore nothing can be updated. Nevertheless the ORM triggers no error and $child looks like having been persisted. In the second request you'll notice that there haven't been persisted any of the data belonging to the child table. ### [DDC-3007] ManyToMany does not respect all column attributes for the jointable Created: 03/Mar/14 Updated: 03/Mar/14 Status: Open Project: Doctrine 2 - ORM Component/s: Mapping Drivers Affects Version/s: None Fix Version/s: None Security Level: All  Type: Bug Priority: Major Reporter: Michael Kühn Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None  Description  Given following 2 entities:  ### [DDC-2990] [GH-956] Foreign association index names Created: 19/Feb/14 Updated: 23/Feb/14 Status: Open Project: Doctrine 2 - ORM Component/s: None Affects Version/s: None Fix Version/s: None Security Level: All  Type: Bug Priority: Major Reporter: Doctrine Bot Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None Issue Links:  Reference relates to DDC-2989 ORM should allow custom index names f... Open  Description  This issue is created automatically through a Github pull request on behalf of jsuggs: Message: ### [DDC-2981] Multi get for second level cache (Doctrine Cache related) Created: 13/Feb/14 Updated: 13/Feb/14 Status: Open Project: Doctrine 2 - ORM Component/s: ORM Affects Version/s: None Fix Version/s: None Security Level: All  Type: Improvement Priority: Major Reporter: Asmir Mustafic Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None  Description  Hi every body! I'm developing an application that is highly based on doctrine second-level cache feature. Using memcache or redis as cache back-end, doctrine have to query thousand times for the cached values (especially on one-to-many and many-to-many associations). This introduces a lot of latency (and network traffic)... I'm thinking to add to Doctrine\Common\Cache\Cache interface a method fetchMulti(array$keys) that fetches multiple items in one call. In this way doctrine orm can ask for many items with just one call (for example, here https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Cache/DefaultCollectionHydrator.php#L84 this feature can be very useful). I have made some real-world tests and it can reduce highly the number of total queries (my app runs 190 cache requests instead of 900 cache requests) Many vendors (memcache, redis, apc ecc) already offer this functionality, but with doctrine-cache we can't use it... I'm going to implement this feature. Can it be accepted as a pull request? It may be BC breaking: it can be implemented adding a method inside Doctrine\Common\Cache\Cache interface (more BC breaking but more clean and elegant) it can be implemented adding an interface Doctrine\Common\Cache\MultiCache and later CacheProvider can implement it (less BC breaking)

 Comment by Marco Pivetta [ 13/Feb/14 ] Adding a method to Doctrine\Common\Cache\Cache is not viable because of BC - a new interface would be ok Comment by Asmir Mustafic [ 13/Feb/14 ] ok, i agree with you. But this forces me to check always here https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Cache/Region/DefaultRegion.php#L95 if $this->cache is instance of MultiCache Comment by Marco Pivetta [ 13/Feb/14 ] Asmir Mustafic or you build a MultiCacheRegion Comment by Asmir Mustafic [ 13/Feb/14 ] It can be a good approach. I will try it. I'm thinking to provide a default implementation of fetchMulti directly inside CacheProvider that internally loops over each key and call CacheProvider::fetch($id) to fetch its value. Later i will overwrite this behavior inside vendor specific driver (ApcCache, RedisCache...)

### [DDC-2983] TCI association not getting hydrated into sql statement Created: 14/Feb/14  Updated: 23/Mar/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.5
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Machete Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: orm Environment: MySQL, using DoctrineORMModule (zf2 integration)

 Description

### [DDC-2891] Impossible to pass a limit to a subquery Created: 07/Jan/14  Updated: 08/Jan/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.4.2
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: alex Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 It seems that passing the limit to a subquery is not working  $subquery =$em->createQueryBuilder()->from('...')->where('...')->setMaxResults(5); $query =$em->createQueryBuilder()->from('...')->where( $qb->expr()->in('p.id',$subquery->getDQL()) ); $query->getQuery()->getResult();  The query works but the is no specified limit in the resulting SQL. I am aware that DQL does not support the limits and offsets, so i guess there should be another way to get this working?  Comments  Comment by Steve Müller [ 08/Jan/14 ] Can you please tell which database platform you are using? Because limiting results heavily depends on the platform used. Comment by alex [ 08/Jan/14 ] MySql Comment by Steve Müller [ 08/Jan/14 ] Hmmm I am not quite sure if the limit/offset is invoked for subqueries but I don't see why it shouldn't. Also I think this is not a DBAL issue because the limit/offset support for MySQL is the easiest we have on all platform. See: https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L51-L63 The query doesn't have to be modified but instead only the limit clause is appended to the query. Can you maybe provide the generated SQL for that query? Comment by alex [ 08/Jan/14 ] I think if you try to build any query with QueryBuilder, set a limit to it with setMaxResults then call getDQL method, you should see that the output contains no info about limit. So if you look at my code example , at$qb->expr()>in('p.id', $subquery>getDQL()), then you will see that the getDQL passes to the IN expression a query which already DOES NOT have limit. So this is the place where any info about limits and offsets gets lost. So I fail to see what it has to do with any specific db engine,however I can provide the mysql resulting query if you want,though it looked perfectly normal to me,just lacks the LIMIT part. ### [DDC-2861] [GH-881] Fix persistence exception on a table with a schema on a platform without schema support Created: 18/Dec/13 Updated: 18/Dec/13 Status: Open Project: Doctrine 2 - ORM Component/s: None Affects Version/s: None Fix Version/s: None Security Level: All  Type: Bug Priority: Major Reporter: Doctrine Bot Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None  Description  This issue is created automatically through a Github pull request on behalf of michaelperrin: Message: This PR solves two related issues with the use of a database schema on platforms (such as SQLite) that don't support schemas. I discovered the issues when I generated the schema from my Doctrine entities on SQLite (for unit test purposes of my application) whereas my main application uses PostgreSQL. This is one of my first PR on Doctrine, so sorry if I made some things in the wrong way and I'm open to discussion. *First problem: table names dots are not converted in the ORM* On a platform like SQLite, DBAL converts table names with dots (ie. a schema is declared) to double underscores. However, the ORM doesn't do it, and persisting leads to an exception. Example:  MyNamespace\Mytable: type: entity table: myschema.mytable ...  And then somewhere in the code: $myTable = new MyNamespace\Mytable(); $entityManager->persist($myTable); $entityManager->flush();  This doesn't work in the current version of Doctrine. The table is created as myschema__mytable but entities are unsuccessfully saved in myschema.mytable. *Second problem: table names with reserved keywords in a database schema are not correctly escaped* When a table name is declared as myschema.order (or any other reserved keyword), only the reserved keyword part is escaped when creating the table, leading to the creation of a table name like myschema__\order\, which is invalid and therefore fails. *How this PR solves the problem* The classmetadata now stores in 2 separated properties the name of the table and the name of the schema. The schema property was partially implemented but I now make a full use of it. When metadata is read (from Annotations, YAML, ...), if the table name has a dot (myschema.mytable), it's splitted into 2 parts, and myschema is saved in the schema table property, and mytable is saved in the name table property, instead of storing the whole myschema.mytable in the name table property. This allows to do specific things about schemas everywhere in Doctrine, and not splitting again parts everywhere it's needed. By the way, the schema property can now fully be used. For instance, these 2 YAML configurations are valid and do the same thing:  MyNamespace\Mytable: type: entity table: myschema.mytable  and:  MyNamespace\Mytable: type: entity table: mytable schema: myschema  This was something which was not finished to be implented since Doctrine 2.0. The Default quote strategy now converts back the schema and table names to a unique table name, depending on the platform (e.g. myschema.mytable if the platform supports schemas, and myschema__mytable otherwise). As a result, there is no problem anymore and entities can be persisted without getting any exception. I added some unit tests for this (the same unit tests failed before of course). There's however a slight tradeoff on performance, as the getTableName of the DefaultQuoteStrategy class adds some tests to return the correct table name. This solved these Doctrine issues: DDC-2825(http://www.doctrine-project.org/jira/browse/DDC-2825) and DDC-2636(http://www.doctrine-project.org/jira/browse/DDC-2636). Again, this is one of my first PRs on Doctrine, so if there's anything wrong or if you have any question, feel free to comment this PR. @Ocramius This PR is about what we talked about in DDC-2825(http://www.doctrine-project.org/jira/browse/DDC-2825) ### [DDC-2851] Allow set custom collection initializer at runtime Created: 12/Dec/13 Updated: 12/Dec/13 Status: Open Project: Doctrine 2 - ORM Component/s: ORM Affects Version/s: 2.4.1 Fix Version/s: None  Type: Improvement Priority: Major Reporter: Konstantin Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None  Description  Use case: Company, Category, CompanyCategory entities. We are loading set of companies and should initialize Company.companyCategories collection with joined categories, which ordered by Company.title. I cann't do it via Criteria API, it doesn't supports joins. + I should return same PersistentCollection instance (Company.companyCategories used in Symfony2 forms). Current workaround:  public function loadCompanyCategoriesCollectionForCompany(Company$company) { $companyCategories =$this->_em->createQueryBuilder() ->select('cc') ->from('OloloCompaniesBundle:CompanyCategory', 'cc') ->join('cc.category', 'c') ->addSelect('c') ->orderBy('c.title') ->where('cc.company = :company') ->setParameter('company', $company) ->getQuery() ->getResult() ;$coll = $company->getCompanyCategories(); foreach ($companyCategories as $companyCategory) { /* @var$coll \Doctrine\ORM\PersistentCollection */ $coll->hydrateAdd($companyCategory); } $coll->setInitialized(true); }  What would be nice: native API for setting custom initializers. ### [DDC-2852] Enclose subquery with parenthesis in from clause (QueryBuilder) Created: 12/Dec/13 Updated: 12/Dec/13 Status: Open Project: Doctrine 2 - ORM Component/s: ORM Affects Version/s: None Fix Version/s: None Security Level: All  Type: Improvement Priority: Major Reporter: Matthieu Pécro Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: from, orm, parenthesis, querybuilder,, subquery  Description  Hi In QueryBuilder from clause, when argument is a QueryBuilder (not a string like a table), there are not parenthesis enclosure on the subquery. Ex:$subqb->select('myfield')->from('mytable'); $qb->from($sub, 'myalias) DQL is : SELECT myfield FROM SELECT myField FROM mytable myalias. This is not working on MySQL. It should be : SELECT myfield FROM (SELECT myField FROM mytable) myalias.

 Comment by Christophe Coevoet [ 12/Dec/13 ] I don't understand your statement This is not working on MySQL. after giving a DQL statement. MySQL does not support any DQL. It runs SQL. And DQL does not support using a subselect in the FROM clause

### [DDC-2841] Preload data for association Created: 06/Dec/13  Updated: 06/Dec/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Przemyslaw Wrobel Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description

### [DDC-2744] Inheritance - Empty value for discriminatorColumn in query Created: 16/Oct/13  Updated: 16/Oct/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None

 Type: Bug Priority: Major Reporter: Daniel Dos Prazeres Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 Hello, I have an inheritance problem with the following classes getRepository('ProjMyBundle:ClassSubOne')->findAll()  the query builded SELECT field, field2 FROM CLASSTOP WHERE AVAL IN ()  The value for the discriminator column is not passed Thanks for your help

### [DDC-2742] 2 ManyToMany relations to the same target entity make the schema update fail by default Created: 15/Oct/13  Updated: 15/Oct/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, Tools
Affects Version/s: 2.4
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Christophe Coevoet Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: mapping, schematool

 Description
 At some point in the Doctrine releases (I don't remember which version it was), the default naming of the join table of a ManyToMany relation changed from using the property name to using the name of the target entity. This makes it impossible to use multiple ManyToMany relations to the same target entity in a class without naming join tables explicitly. A SchemaException is thrown by the SchemaTool when trying to update the schema. Note that this issue is not caught by the SchemaValidator. It will display us that the mapping files are correct (before throwing the above exception in the second step when trying to compare it to the existing database)

pager produces wrong results on postgresql (DDC-1958)

### [DDC-2729] Same bug affects SQLServer2008Platform Created: 07/Oct/13  Updated: 07/Oct/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.4
Fix Version/s: None
Security Level: All

 Type: Sub-task Priority: Major Reporter: Rafi Adnan Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: paginator Environment: SQL Server 10.50.1617 unixODBC 2.2.14 PHP 5.4.19

 Description
 If the class is patched with the following: if ($this->platform instanceof SQLServer2008Platform) {$this->preserveSqlOrdering($AST,$sqlIdentifier, $innerSql,$sql); } It fixes the issue.

### [DDC-2727] "Expression" or "Update" API, similar to the Criteria API Created: 07/Oct/13  Updated: 07/Oct/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Matthieu Napoli Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 I created a discussion in the mailing list (https://groups.google.com/forum/#!topic/doctrine-dev/7HfEqOwhkDk) but no answer, so I'm moving the discussion here. The Criteria API provides an abstraction to filter collections/repositories, may they be in memory (filtering in PHP) or in a database (filtering using a SQL query). I was thinking about an "Expression" API which would work like array_map to apply changes in bulk to entities. For example, if you have a collection where entities have a $position field, if I insert an item in the list, I have to increment the position of all the following items. For this, I have 2 options: PHP: loading the entities in memory, iterate over them and increment$position SQL: run a UPDATE position=position + 1 WHERE … The second option is much more efficient, but it breaks the abstraction of the model because I have some behavior written explicitely in SQL. Furthermore, the objects loaded in memory will note be updated with the SQL query. So the "Expression" API would work like the Criteria API: interface Updatable { public function apply(Expression $e); }$expression = new Expression(); // For each item after position "10" $expression->criteria->where(Criteria::expr()->gt('position', 10)); // Increment the position$expression->set('position', 'position + 1'); $collection->map($expression);  The expression here would be applied: in memory if the collection is already loaded else in database using SQL The expression could be applied to a Collection and to a Repository (like the Criteria). About the API offered by the Expression class, there are several options: // Option 1 // More powerful, but needs to parse and evaluate the string class Expression { public $criteria; public function set($field, $value); }$expression->set('position', 'position + 1'); // Option 2 // Easier to implement, more limited class Expression { public $criteria; public function setValue($field, $value); public function setValueFromField($targetField, $sourceField); public function add($field, $number); public function multiply($field, $number); public function divide($field, $number); } // Option 3 // Like option 2 but more extensible class Expression { public$criteria; public function set($field, Operation$operation); }  I think I like the third one better because we have full control over the supported operations, and adding support to new kinds of operation is easy. The first one would require defining a whole language of allowed expressions... What do you think of all that?

 Comment by Matthieu Napoli [ 07/Oct/13 ] Added option 3 after trying to write a POC Comment by Matthieu Napoli [ 07/Oct/13 ] Here is a POC on the doctrine/collections side: https://github.com/mnapoli/collections/compare/master...feature;Updatable works with ArrayCollection I'm looking at the ORM side. Feedback welcome, especially with the class/namespace/method names.

### [DDC-2709] Defining Columns as "Updatable" or "Insertable" Created: 27/Sep/13  Updated: 27/Sep/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Martin Prebio Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 With Hibernate I can define a column as Updatable/Insertable or non-Updatable/non-Insertable so that this field is considered read-only and is not part of any update/insert statement. I'd like to have the same possibility in Doctrine. In my use case a value is generated and maintained by database triggers. In my application I only want to read this value but the application should never try to insert or update the column. Updatable/Insertable in the Hibernate documentation: http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/#entity-mapping-property-column

### [DDC-2704] When using Discriminator EntityManager#merge fails Created: 25/Sep/13  Updated: 25/Sep/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.4
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Vladyslav Petrovych Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 I have the following hierarchy: AgentConfig has relation ManyToOne with AgentTask. AgentTask has DiscriminatorColumn & DiscriminatorMap assigned to it. AgentTask has relation ManyToOne with AgentTaskConfig. I believe the problem is because of the following: UnitOfWork#doMerge has the tries to get properties the following way: // Merge state of $entity into existing (managed) entity foreach ($class->reflClass->getProperties() as $prop) {  This obviously doesn't get the parent class (AgentTask) properties. Later on UnitOfWork fails on line: $prevClass->reflFields[$assocField]->getValue($prevManagedCopy)->add($managedCopy);  because$prevManagedCopy doesn't have properties set from entity. My proposal is to get the properties the following way: $properties =$class->reflClass->getProperties(); $parent =$class->reflClass; while (($parent =$parent->getParentClass()) != null) { $properties = array_merge($parent->getProperties(), $properties); } // Merge state of$entity into existing (managed) entity foreach ($properties as$prop) { 

### [DDC-2691] Test Suite: Drop other connections before dropping database PostgreSQL Created: 19/Sep/13  Updated: 19/Sep/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: Git Master
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Flip Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None Environment: Windows 7 Professional 64 bits PHP 5.4.11 (cli) (built: Jan 16 2013 20:26:26) Doctrine dev-master from 18-9-2013 PostgreSQL 9.2.4 build 1600, 64-bits

 Description
 The test suite is trying to run the command DROP DATABASE doctrine_tests  This fails, together with lots of tests when another user is connected (for example through the pgAdmin program). It would be nice if the test suite had an option to drop existing connections, which can be done with the following command: SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'doctrine_tests'; 

### [DDC-2697] ObjectHydrator::hydrateRowData fails to hydrate first fetch joined entity Created: 20/Sep/13  Updated: 06/Dec/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3, 2.4
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Austin Morris Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: orm Environment: All

 Description
 Let's say I have accounts, contacts, and contact types. Any given contact can have be any kind of contact type to any account. This is all managed through an account_contacts table with a 3-way composite PK of the contact_id, account_id, and type_id. All of this translates to 4 entities, the account, contact, type, and accountContact entity. The id of the accountContact entity is the three other entities which is holds. When I use query builder to retrieve the accountContacts based on some condition, and also fetch join contacts, accounts, and types so that they are eagerly loaded, the ObjectHydrator fails to load the first accountContact returned. This is because the first time through hydrateRowData, the fetch joined entities are hydrated first. The problem is $this->_rsm->parentAliasMap[$dqlAlias] does not contain an entry for the accountContact (root entity). Not until an accountContact is hydrated does that get set. In the mean time, the other three entities were set to null because there is no parent alias yet (in version 2.4, this is line 405. Subsequent loops through hydrateRowData work because by this time the parent alias is set. But that first row returned is always an accountContact containing three null objects.

### [DDC-2516] Undefined offset in ObjectHydrator while working with iterableResult Created: 19/Jun/13  Updated: 01/Jul/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3.4
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Johanny Clerc-Renaud Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: orm Environment: using Symfony2

 Description
 Following this documentation page http://doctrine-orm.readthedocs.org/en/2.0.x/reference/batch-processing.html#iterating-large-results-for-data-processing I tried to create a batch process on 75k entities. But an error came in the ObjectHydrator on line 511 there's an Undefined offset. Now, i just use the SimpleObjectHydrator and it solve the problem. but i'm wondering if it's a real bug or just a miss use of Doctrine. Reproduce this error could be hard so ask if you want me to give you more informations about it.

 Comment by Benjamin Eberlei [ 30/Jun/13 ] Can you provide more information? The stack trace of the error for example? The entity you try to process+mapping and the DQL query. The current information is not enough to reproduce this error. Comment by Johanny Clerc-Renaud [ 01/Jul/13 ] Hello Benjamin, here is the Entity and with the corresponding Mapping : Entity.php  /** * @var string * @ORM\Id * @ORM\Column(name="id_source", type="string", length=32, nullable=false) */ private $idSource; /** * @var string * * @ORM\Column(name="id_page", type="string", length=32, nullable=false) */ private$idPage; /** * @var string * * @ORM\Column(name="url", type="string", length=500, nullable=true) */ private $url; /** * @var float * * @ORM\Column(name="similitude", type="decimal", nullable=true) */ private$similitude; /** * @var string * * @ORM\Column(name="alerte", type="string", length=512, nullable=true) */ private $alerte;  The Entity have been generated by using this documentation page : http://symfony.com/doc/current/cookbook/doctrine/reverse_engineering.html In this project I work with 2 databases, and one of it already exist. Working with symfony I use the DQL Query obtain with those methods : EntityRepository.php  public function getAllUrl($limit) { $queryBuilder =$this->createQueryBuilder('s'); $this->setStatsParameters($queryBuilder); $queryBuilder->setMaxResults($limit); return $queryBuilder->getQuery() ->iterate(); } private function setStatsParameters(\Doctrine\ORM\QueryBuilder$queryBuilder) { $queryBuilder->where('s.similitude > 1') ->andWhere('s.url NOT LIKE :url') ->setParameter('url', 'some_string%'); }  And here is the stack trace, when the eror comes : stackTrace.log Exception trace: () at \path\to\project\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php:511 Symfony\Component\Debug\ErrorHandler->handle() at \path\to\project\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\ObjectHydrator.php:511 Doctrine\ORM\Internal\Hydration\ObjectHydrator->hydrateRowData() at \path\to\project\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\AbstractHydrator.php:136 Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateRow() at \path\to\project\vendor\doctrine\orm\lib\Doctrine\ORM\Internal\Hydration\IterableResult.php:76 Doctrine\ORM\Internal\Hydration\IterableResult->next() at \path\to\project\src\Compilatio\RecolteurBundle\Command\RecolteurCommand.php:42 CompanyName\RecolteurBundle\Command\RecolteurCommand->execute() at \path\to\project\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:244 Symfony\Component\Console\Command\Command->run() at \path\to\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:906 Symfony\Component\Console\Application->doRunCommand() at \path\to\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:191 Symfony\Component\Console\Application->doRun() at \path\to\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:80 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at \path\to\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:121 Symfony\Component\Console\Application->run() at \path\to\project\app\console:27  You can also see here the source code that lead to this error : command.php $sources = $urlLoader->getAllSources(50000);$number = 0; while (($source =$sources->next()) !== false) { $number++; } echo 'Nombre de sources : ' .$number;  There are all the information you ask, if you need more just tell me. For now i can see how to be more specific. Remember that if I switch the hydrator to Query::HYDRATE_SIMPLEOBJECT it solve the bug. I hope all of this will help. Regards, Johanny

### [DDC-2504] [GH-696] extra lazy joined test Created: 14/Jun/13  Updated: 14/Jun/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Doctrine Bot Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of Padam87: Message: Hi, This is just a bug report, not an actual PR, you don't have to merge. When you have a JOINED inheritance, and you have another class, which is related to the parent class of the inheritance, and you only have an association for one of the child classes, EXTRA_LAZY fetch mode creates a fatal error, because it is not joining the parent table to the count query. There are many ways around this fortunately, but I thought I should report it anyway.

### [DDC-2495] Partial objects not working with STI Created: 10/Jun/13  Updated: 11/Jun/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3.4
Fix Version/s: None

 Type: Bug Priority: Major Reporter: Radoslaw Ejsmont Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: STI, dql, orm, partial Environment: Symfony2 project, Doctrine ORM with MySQL database backend

 Attachments: CrossVial.php     Entity.php     InjectionVial.php     Stock.php     StockVial.php     Vial.php

 Description
 When I try to create a query retrieving partial objects of a root class in single table inheritance hierarchy, the resulting SQL includes all fields from the whole class hierarchy. DQL: SELECT partial v. {id, setupDate, flipDate} FROM VIB\FliesBundle\Entity\Vial v WHERE v.id IN (1,2,3,4,5,6,7,8,9,10) SQL: SELECT v0_.setupDate AS setupDate0, v0_.flipDate AS flipDate1, v0_.id AS id2, v0_.type AS type3, v0_.parent_id AS parent_id4, v0_.position_id AS position_id5, v0_.prevPosition_id AS prevPosition_id6, v0_.incubator_id AS incubator_id7, v0_.stock_id AS stock_id8, v0_.male_id AS male_id9, v0_.virgin_id AS virgin_id10, v0_.targetStock_id AS targetStock_id11, v0_.targetStockVial_id AS targetStockVial_id12 FROM Vial v0_ WHERE (v0_.id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) AND v0_.type IN ('vial', 'stock', 'cross', 'injection')

### [DDC-2477] [GH-681] Sequence generator fix Created: 29/May/13  Updated: 29/May/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Doctrine Bot Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description

### [DDC-2411] Null values get reset when rehydrating an already managed entity Created: 23/Apr/13  Updated: 09/May/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Simon Garner Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: hydration

 Description

### [DDC-2351] Entity Listener vs. Event Listener Created: 15/Mar/13  Updated: 15/Mar/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: Git Master
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Fabian Spillner Assignee: Fabio B. Silva Resolution: Unresolved Votes: 0 Labels: None

 Description
 Entity Listener and Event Listener don't get same events. An example is the onFlush event, which Entity Listener doesn't get. Why are both listeners receiving different events and not same events? For consistency I'd like to see that both get same events - if I understand the purpose of Entity Listener correctly: it should be an alternative to Event Listener with same functionality but is bound to an entity.

 Comment by Benjamin Eberlei [ 15/Mar/13 ] onFlush and postFlush should be propagated to entity listeners as well

### [DDC-2352] [GH-615] Update SqlWalker.php Created: 15/Mar/13  Updated: 15/Mar/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of mikemeier: Message: Always be sure that only a-z characters are used for table alias, otherwise use generic "t" for "table"

### [DDC-2337] Allow an entity to use its own persister to take advantage of DB level features if necessary Created: 06/Mar/13  Updated: 06/Mar/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, ORM
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Nathanael Noblet Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Attachments: persister.patch

 Description
 I have a situation where I wanted a single table to use INSERT DELAYED. Its an audit log table where I expect each http request to generate many inserts for. In an effort to not over tax the system I implemented a custom Entity Persister so that it would work. This obviously doesn't work with all mapping drivers. However if this is a feature that you think is worth integrating I will fork it on github and complete the implementation alongside any changes/improvements requested...

### [DDC-2290] Infer custom Types from the field for query parameters Created: 08/Feb/13  Updated: 28/Jan/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Matthieu Napoli Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 3 Labels: None

 Description
 When using a mapping Type that declares convertToDatabaseValue, the method is not always called in queries. Example: SELECT ... WHERE entity.field = ?1  (with entity.field being of custom type 'the_mapping_type') Type::convertToDatabaseValue() is correctly called when using: $query->setParameter('1', 'foo', 'the_mapping_type');  But it is not called when using: $query->setParameter('1', 'foo');  which gives a query that returns invalid results. Like other mapping types in this situation, there is no reason the type is not inferred automatically from the field. I have written a failing test case in Doctrine\Tests\ORM\Functional\TypeValueSqlTest:  public function testQueryParameterWithoutType() { $entity = new CustomTypeUpperCase();$entity->lowerCaseString = 'foo'; $this->_em->persist($entity); $this->_em->flush();$id = $entity->id;$this->_em->clear(); $query =$this->_em->createQuery('SELECT c.id from Doctrine\Tests\Models\CustomType\CustomTypeUpperCase c where c.lowerCaseString = ?1'); $query->setParameter('1', 'foo');$result = $query->getResult();$this->assertCount(1, $result);$this->assertEquals($id,$result[0]['id']); } 

### [DDC-2219] computeChangeSets array_merging for associationMappings problem ? Created: 02/Jan/13  Updated: 07/Jan/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Documentation Priority: Major Reporter: yohann.poli Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: unitofwork

 Description

### [DDC-2190] findBy() support finding by a single DateTime but not by multiple DateTime Created: 06/Dec/12  Updated: 09/May/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Christophe Coevoet Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Attachments: DDC2190Test.php

 Description
 The following code works: $repository->findBy(array('date' => new \DateTime())) but the following code fails as it does not apply the conversion of the date type for each element: $repository->findBy(array('date' => array(new \DateTime(), new \DateTime('tomorrow')))

 Comment by Benjamin Eberlei [ 06/Jan/13 ] This is actually very hard to implement, the problem is that we only have ARRAY constants for PDO::PARAM_INT and PDO::PARAM_STR - all the other types would require special handling. Comment by Benjamin Eberlei [ 09/May/13 ] Attaching failing testcase. The idea is to have something like "datetime[]" as type and detect this in the SQLParserUtils of DBAL. Another approach would be to convert the values in the ORM already, before passing to the DBAL.

### [DDC-2185] Better explain DQL "WITH" and implications for the collection filtering API Created: 04/Dec/12  Updated: 17/Dec/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: Documentation, DQL
Affects Version/s: 2.2
Fix Version/s: None
Security Level: All

 Type: Documentation Priority: Major Reporter: Matthias Pigulla Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: collection, documentation, dql, filtering

 Description
 Available documentation is a bit thin regarding the "WITH" clause on JOIN expressions. Only a single example is provided in http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html#dql-select-examples WITH seems to allow to only "partially" load a collection, so the collection in memory does not fully represent the associations available in the database. The resulting collection is marked as "initialized" and it seems there is no way to tell later on whether/how (with which expression) the collection has been initialized. When using the collection filtering API, the "initialized" flag on the collection will lead to in-memory processing. If a collection has been loaded WITH a restricting clause and another filter is applied later, results may not be what one might expect. I assume this is by design (no idea how the collection could be "partially" loaded and behave correctly under all conditions), so filing it as a documentation issue.

 Comment by Matthias Pigulla [ 17/Dec/12 ] An additional observation: If you eager-load a collection using WITH, for the resulting entities that collection is marked as initialized as described above. Should you happen to come across the same entity during hydration in another (later) context where you explicitly eager load the same association without the WITH restriction (or with another one), the collection on that (existing) entity won't be re-initialized and still contains the associated objects found during the first query.

### [DDC-2170] Decorator base classes for query related objects Created: 26/Nov/12  Updated: 26/Nov/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Lars Strojny Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 Doctrine\ORM\Query should not be directly extendable but it would be nice to decorate query objects and add additional methods. Use cases are e.g. doctrine-fun (see https://github.com/lstrojny/doctrine-fun/blob/master/src/Doctrine/Fun/Query.php) or even cases where users want to add domain specific methods. As Doctrine\ORM\Query is final it is not so easy to decorate correctly. I would propose: Add a new interfaces: Doctrine\ORM\QueryInterface that provides a contract for all methods Doctrine\ORM\Query provides Add a decorator base class Doctrine\ORM\QueryDecorator as an extension point Some for NativeQuery and QueryBuilder

 Comment by Lars Strojny [ 26/Nov/12 ] Related:

### [DDC-2167] [GH-522] [DDC-2166] Refactor identity hash generation Created: 25/Nov/12  Updated: 01/May/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of beberlei: Message: This work prepares for the merge of GH-232, allowing more complex and robust identifier hash generation.

### [DDC-2166] Improve Identifier hashing in IdentiyMap Created: 25/Nov/12  Updated: 25/Nov/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 There are currently some drawbacks with identifier hashing: They only work on one level for derived keys The code is suspect to high performance requirements Composite Keys might be suspect to weird bugs if they contain spaces. There is a PR by goetas (https://github.com/doctrine/doctrine2/pull/232) that solves some issues, however adds a performance hit. We should move the conditional logic of this code out and use a strategy pattern to improve both performance and robustness of this code.

### [DDC-2154] Traits and Code Generation Created: 18/Nov/12  Updated: 18/Nov/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description

### [DDC-2119] Problem with inheritance type: INHERITANCE_TYPE_NONE and INHERITANCE_TYPE_TABLE_PER_CLASS Created: 03/Nov/12  Updated: 08/Apr/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: DQL, Tools
Affects Version/s: 2.1
Fix Version/s: None

 Type: Bug Priority: Major Reporter: SergSW Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: dql, schematool

 Attachments: dump.sql     SSWTestBundle.rar

 Description

### [DDC-2102] Make optional SubselectFromClause Created: 25/Oct/12  Updated: 25/Oct/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Martin Hasoň Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 Subselect ::= SimpleSelectClause [SubselectFromClause] [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]

### [DDC-2100] Getting Started: Code First PHP fatal error:Call to undefined method Bug::setDescription() Created: 24/Oct/12  Updated: 24/Oct/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3
Fix Version/s: None

 Type: Documentation Priority: Major Reporter: bronze1man Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None Environment: ubuntu 1204 php5.3.8

 Description
 http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html in file create_bug.php $bug->setDescription("Something does not work!"); but the class Bug do not have setDescription function. ps: try find "setDescription" on that page. there is only one . ### [DDC-2093] Doctrine Criteria does not support sorting by relationed field Created: 20/Oct/12 Updated: 06/Jan/13 Status: Open Project: Doctrine 2 - ORM Component/s: ORM Affects Version/s: Git Master Fix Version/s: None Security Level: All  Type: Improvement Priority: Major Reporter: Bogdan Yurov Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None  Description  // Here I call Criteria filter public function getWalletsActive() {$criteria = Criteria::create() ->where(Criteria::expr()->eq("isRemoved", "0")) ->orderBy(array("currency.id" => "ASC")); return $this->wallets->matching($criteria); } // Relation /** * @var Currency * * @ORM\ManyToOne(targetEntity="Currency") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="id_currency", referencedColumnName="id") * }) */ protected $currency; // File BasicEntityPersister.php // This cause the problem: if ( ! isset($this->_class->fieldMappings[$fieldName])) { throw ORMException::unrecognizedField($fieldName); } // There are no relations in $this->_class->fieldMappings at all!   Comments  Comment by Benjamin Eberlei [ 06/Jan/13 ] Mark as improvement. ### [DDC-2089] Modify OneToMany to allow unidirectional associations without the need of a JoinTable Created: 19/Oct/12 Updated: 07/Sep/13 Status: Open Project: Doctrine 2 - ORM Component/s: ORM Affects Version/s: 2.x Fix Version/s: 3.0, 2.5 Security Level: All  Type: Improvement Priority: Major Reporter: Enea Bette Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: onetomany, persister, unidirectional Environment: Debian Wheezy, Mysql 5.1, Apache2, PHP 5.4  Description  As I sayd in the title, it would be nice if the ORM layer could permit to map a 1:n association in the db as an unidirectional OneToMany in the classes, without using a JoinTable in the database. This would permit us to get rid of the unnecessary database JoinTable, which creates disorder and decreases performance for no valuable reason. Is it possible?  Comments  Comment by Enea Bette [ 16/Dec/12 ] A little up... for inspiration from JPA http://en.wikibooks.org/wiki/Java_Persistence/OneToMany#Undirectional_OneToMany.2C_No_Inverse_ManyToOne.2C_No_Join_Table_.28JPA_2.0_ONLY.29 ### [DDC-2087] Select colum Hydration Created: 18/Oct/12 Updated: 18/Oct/12 Status: Open Project: Doctrine 2 - ORM Component/s: None Affects Version/s: None Fix Version/s: None  Type: New Feature Priority: Major Reporter: Ivan Borzenkov Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None  Description  Simple way to select colum for example I want select id's of entity's to save in cache or in other select query Or i vant select one distinct field. SELECT u.id FROM User as u getResult give array( 0=>array('id' => 1), 1=>array('id' => 2), ) but how can take this array( 0=> 1, 0=> 2, )  Comments  Comment by Ivan Borzenkov [ 18/Oct/12 ] for example http://stackoverflow.com/questions/11327798/change-the-getresult-array-key-for-the-primary-key-value this code would be good add in library (and array key maybe too ) ### [DDC-2043] Extra cache operation in DBAL\Cache\ResultCacheStatement.php Created: 26/Sep/12 Updated: 26/Sep/12 Status: Open Project: Doctrine 2 - ORM Component/s: ORM Affects Version/s: 2.3 Fix Version/s: None Security Level: All  Type: Improvement Priority: Major Reporter: Bogdan Albei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None Environment: CentOS, PHP 5.3.10  Description  This is the closeCursor() method in DBAL\Cache\ResultCacheStatement.php: public function closeCursor() {$this->statement->closeCursor(); if ($this->emptied &&$this->data !== null) { $data =$this->resultCache->fetch($this->cacheKey); if ( !$data) { $data = array(); }$data[$this->realKey] =$this->data; $this->resultCache->save($this->cacheKey, $data,$this->lifetime); unset($this->data); } }  We are using Memcache and I noticed an extra GET operation on all cache misses. In the code above I believe the fetch call is not necessary and that the code would do the same without it. Also, may I ask why is the SQL used as a key in the cached data?  Comments  Comment by Christophe Coevoet [ 26/Sep/12 ] The SQL is used as a key because it is what identifies the query which is done (well, the statement and the parameters) Comment by Bogdan Albei [ 26/Sep/12 ] The cacheKey already identifies the query(or at least it should). Would we have cases where different queries would want to use the same cache key? ### [DDC-2042] Metadata association overriding : allow to override 'targetEntity' Created: 26/Sep/12 Updated: 31/Mar/14 Status: Open Project: Doctrine 2 - ORM Component/s: ORM Affects Version/s: None Fix Version/s: None Security Level: All  Type: Improvement Priority: Major Reporter: Charles Rouillon Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None  Description  While associating object to an descriminated table I wasn't enable to fix the entityTarget (only one can be set in entity annotation). It could be resolve by adding the possibility to override 'targetEntity' value in Doctrine\ORM\Mapping\ClassMetadataInfo::ClassMetadataInfo(). Such as : if (isset($overrideMapping['targetEntity'])) { $mapping['targetEntity'] =$overrideMapping['targetEntity']; } That would need to add a control on the new targetEntity in Doctrine\ORM\Mapping\ClassMetadataInfo::_validateAndCompleteAssociationMapping(). Such as : if ( ! ClassLoader::classExists($mapping['targetEntity']) ) { throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name,$mapping['fieldName']); } cro.

 Comment by Oleg Namaka [ 31/Mar/14 ] We need this feature too. Why is this ticket in a limbo? Someone please add a comment whether this will be fixed. Comment by Marco Pivetta [ 31/Mar/14 ] Oleg Namaka you can open a pull request with a test and suggested improvement for this at https://github.com/doctrine/doctrine2

### [DDC-2007] [GH-434] allowed to pass filter objects to the configurator Created: 31/Aug/12  Updated: 18/Dec/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of bamarni: Message: If DDC-2004 gets approved.

 Comment by Doctrine Bot [ 18/Dec/13 ] A related Github Pull-Request [GH-434] was closed: https://github.com/doctrine/dbal/pull/434

### [DDC-1999] Lazy loading doesn't get the field type when generating sql Created: 29/Aug/12  Updated: 29/Aug/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: victor Velkov Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 When calling with lazy loading the Sql generated doesn't convert the parameters according to their types. After debugging the problem I found that the problem is in the getType($field,$value) function in the BasicEntityPersister as it is it will never be able to return the filed type when called for lazy loading for oneToMany or ManyToMany. I put a quick fix for my self  private function getType($field,$value) { switch (true) { //here we have original code default: $type = null; // my fix starts here$fieldParts = explode('.', $field); if (count($fieldParts > 1)) { foreach ($this->_class->associationMappings as$mapping) { if (isset($mapping['joinColumnFieldNames'][$fieldParts[1]])) { $targetClass =$this->_em->getClassMetadata($mapping['targetEntity']); if (isset($targetClass->fieldNames[$fieldParts[1]])) {$type = $targetClass->fieldMappings[$targetClass->fieldNames[$fieldParts[1]]]['type']; } break; } } } //my fix end here } //here we have original code return$type; }  i have only added that check in the default case of the switch. I am not sure if that is the most elegant way. I hope that helps and that it will be fixed soon. Thanks for the great work .

 Comment by Benjamin Eberlei [ 29/Aug/12 ] Fabio B. Silva Guilherme Blanco do we have a current best practice/policy regarding casting of join column types? There are some issues regarding it, this is another one. Comment by Guilherme Blanco [ 29/Aug/12 ] We avoid the manual breakdown of path expressions. Also, in BasicEntityPersister it is done behind the scenes and can get into weird scenarios. Personally speaking, I don't see how we can easily fix this issue.

### [DDC-2002] [GH-432] Add DBAL\TypeAwareObject type inference. Created: 29/Aug/12  Updated: 27/Nov/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of Romain-Geissler: Message: DBAL allows you to define custom field types for your entities, and those are seamlessly converted from PHP to SQL value. However, you can't those custom types as parameters without type hinting it : php $qb->select('e') ->from('Entity', 'e') ->where('e.customField = :customFieldValue') ->setParameter('customFieldValue',$customFieldValue,$customFieldDBALType); //this third argument is for now compulsory :  In my case, $customFieldValue is an object that won't work well if converted with the default string type. I added a new DBAL interface (see doctrine/dbal#193 ) and tweaked the parameter type inference so that custom values can advertise their DBAL type. There is currently no way to dynamically override the parameter type inference logic, this is one design that allows it in some cases.

 Comment by Benjamin Eberlei [ 30/Aug/12 ] A related Github Pull-Request [GH-432] was closed https://github.com/doctrine/doctrine2/pull/432 Comment by Doctrine Bot [ 27/Nov/13 ] A related Github Pull-Request [GH-432] was closed: https://github.com/doctrine/dbal/pull/432

### [DDC-1991] Add parameter indexBy to EntityRepository->createQueryBuilder() Created: 20/Aug/12  Updated: 20/Aug/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Philipp Cordes Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 createQueryBuilder() currently doesn’t have a parameter to set the third option on the FROM fragment: indexBy. Right now you have to read it, create a new From with the read properties and your desired indexBy value and replace the existing one on the QueryBuilder. Should be ten minutes’ work including tests. Thanks a lot!

### [DDC-1971] [GH-419] Add ODM embedded-like functionality Created: 07/Aug/12  Updated: 20/Dec/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of djlambert: Message: This PR adds ODM embedded-like functionality to the ORM. Including the new @MappedAssociation annotation on a field having a one-to-one association adds a discriminator column to the table for storing the class name of a "mapped" entity. This allows a class or mapped superclass with a one-to-one identifying association to be extended by additional entities without requiring any code changes (as is required with the discriminator map when using inheritance). I apologize if this is the incorrect way to submit a feature request. Currently just the annotation driver has been updated, I wanted to get feedback before continuing with the remaining drivers. Models and tests are included.

 Comment by Doctrine Bot [ 20/Dec/13 ] A related Github Pull-Request [GH-419] was closed: https://github.com/doctrine/dbal/pull/419

### [DDC-1960] mapping joins in native queries breaks if select columns are starting with columns from joined table Created: 31/Jul/12  Updated: 21/Nov/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.4, 2.1.7
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Thomas Subera Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None Environment: ubuntu kernel 2.6.32-40-server php 5.3.10-1ubuntu2ppa6~lucid with Suhosin-Patch (cli) apache 2 2.2.14-5ubuntu8.9 postgres 9.1.4-1~lucid4

 Attachments: testcase.zip

 Description

### [DDC-1817] Allowing to specify MySQL Collation on Field Basis Created: 08/May/12  Updated: 11/Feb/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, Tools
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Johannes Schmitt Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 It would be nice to be able to specify which collation to use on a field basis. This would for example be useful when you have case-sensitive (utf8_bin), and case-insensitive (utf8_general_ci) values. Right now, this needs to be manually added to migration files (which is ok for projects, but it is not so nice for distributable libraries).

 Comment by Steve Müller [ 26/Nov/13 ] See the following PRs: This will be available via column's customSchemaOptions. Comment by Doctrine Bot [ 11/Feb/14 ] A related Github Pull-Request [GH-245] was closed: https://github.com/doctrine/dbal/pull/245

### [DDC-1820] [GH-348] [DDC-1819][WIP] Arbitrary object hydrator Created: 14/May/12  Updated: 27/May/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of marijn: Message: Initial work (in progress) on a test suite for the arbitrary object hydrator, as discussed in DDC-1819[1]. Any tips are appreciated. I'm not too sure what the test suite should and should not cover. Other questions I have include: 1. Should the HYDRATE_ARBITRARY_OBJECT constant be added to the AbstractQuery class or the NativeQuery class? It only makes sense in the former but it might be missed when more constants are added in the future... 2. Should I use data providers in my tests for the result set data? 3. Should my tests be added to a DDC1819 namespace? 4. Should I add functional tests?

### [DDC-1785] Paginator problem with SQL Server around DISTINCT keyword. Created: 18/Apr/12  Updated: 19/Jan/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.1
Fix Version/s: None
Security Level: All

 Type: Bug Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 PDOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'DISTINCT'. (uncaught exception)

 Comment by Craig Mason [ 18/Oct/12 ] There are four major issues with this: 1: SQLServerPlatform.php modifies the query to prepend 'SELECT ROW_NUMBER() OVER ($over)', which is inserted before the DISTINCT keyword. 2: The order needs to be placed inside the OVER($over) block. At this point, the regex is using the exact column name rather than the alias, so the outer query cannot ORDER. 3: The DISTINCT queries select only the ID columns - as OVER() required the sort column to be available in the outer query, IDs alone will not work. 4: SQL Server cannot DISTINCT on TEXT columns. 2005,2008 and 2012 recommend using VARCHAR(MAX) instead, which does support it. That doesn't help us with 2003. We work around that with a custom TEXT type that casts as varchar. Incidentally, 2012 supports LIMIT, which gets rid of this issue altogether. Edit: Added #3 Comment by Craig Mason [ 18/Oct/12 ] I have a (very hacky) implementation working that uses regexes to correct the query so that it will execute. This also required modification in the ORM paginator, to select all columns instead of just IDs. This is certainly not a patch - more guidance. One interesting point... I had to wrap the whole query in a second SELECT *, as the WHERE IN confusingly returns non-distinct rows when part of the first inner query. No idea why this happens, but moving it out one layer makes it operate correctly. Comment by Craig Mason [ 25/Oct/12 ] Updated, view all commits for this experimental branch here: https://github.com/CraigMason/dbal/commits/mssql-distinct Comment by Craig Mason [ 29/Oct/12 ] This got waaaay too messy with regex alone due to the complicated nesting. As such, I have written the basis of a new SqlWalker class which can be used to create DISTINCT queries based on the root identifiers. It's not proper DISTINCT support, but it's a step forward. https://github.com/CraigMason/DoctrineSqlServerExtensions I've also added a Paginator (which was the original issue I had!) The current SqlWalker always sticks the ORDER BY on the end of the query, which just doesn't work properly with SqlServer. Is a vendor-specific walker breaking the DQL abstraction? Should this type of code be on the Platform object in the DBAL? Anyway, this repo fixes our immediate problem, and it would be good to revisit this in a wider context. Hopefully we can get some good SQL server support - there are plenty of other issues to deal with (UTF-8/UCS2, nvarchar etc) Comment by Benjamin Eberlei [ 19/Jan/13 ] Craig Mason We don't have an SQL Server expert on the team, so if you want really good support you should join and help us with it.

### [DDC-1756] Allow for master table only models on joined subclass inheritance Created: 03/Apr/12  Updated: 03/Apr/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Markus Wößner Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description

### [DDC-1760] [GH-324] simplified __call method Created: 03/Apr/12  Updated: 07/Apr/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of brikou: Message:

 Comment by Benjamin Eberlei [ 04/Apr/12 ] A related Github Pull-Request [GH-324] was synchronize https://github.com/doctrine/doctrine2/pull/324 Comment by Benjamin Eberlei [ 06/Apr/12 ] A related Github Pull-Request [GH-324] was synchronize https://github.com/doctrine/doctrine2/pull/324 Comment by Benjamin Eberlei [ 07/Apr/12 ] A related Github Pull-Request [GH-324] was synchronize https://github.com/doctrine/doctrine2/pull/324

### [DDC-1750] [GH-319] [WIP] Added support to Multiple ID Generators Created: 01/Apr/12  Updated: 27/May/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 This issue is created automatically through a Github pull request on behalf of guilhermeblanco: Message:

 Comment by Benjamin Eberlei [ 01/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319 Comment by Benjamin Eberlei [ 01/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319 Comment by Benjamin Eberlei [ 02/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319 Comment by Benjamin Eberlei [ 02/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319 Comment by Benjamin Eberlei [ 03/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319 Comment by Benjamin Eberlei [ 03/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319 Comment by Benjamin Eberlei [ 04/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319 Comment by Benjamin Eberlei [ 06/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319 Comment by Benjamin Eberlei [ 07/Apr/12 ] A related Github Pull-Request [GH-319] was synchronize https://github.com/doctrine/doctrine2/pull/319

### [DDC-1738] Allow multiple Generators per class Created: 29/Mar/12  Updated: 07/Sep/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: Git Master
Fix Version/s: 2.5
Security Level: All

 Type: Improvement Priority: Major Reporter: Guilherme Blanco Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 We should be able to support multiple generators per class. When doing partition per table, the partitioned column must be part of PK, which may enter in our limitation. Currently we only support 1 generator per class.

### [DDC-1732] Unserialized non-initialized proxy classes should throw an exception when a method is called Created: 28/Mar/12  Updated: 28/Mar/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2, Git Master
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Benjamin Morel Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Attachments: ProxyFactory.php.patch

 Description

### [DDC-1602] Executors for Class Table Inheritance (JOINED) are extremely slow on MySQL Created: 15/Jan/12  Updated: 27/Jun/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: 2.2-BETA2
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Michael Moravec Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 3 Labels: None Environment: Debian, MySQL 5.5.17

 Description

Update and delete executors for Class Table Inheritance (JOINED) are extremely slow on MySQL platform. It is most probably due to use of subselect on the temporary table.
The slowdown is really significant as the table size increases. As an example, lets have a root entity with one subclass:

/**
* @Entity
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"root" = "Root", "a" = "SubA"})
*/
class Root
{
/**
* @Column(type="integer")
* @Id
* @GeneratedValue
*/
private $id; /** * @Column(type="integer") */ private$xyz;
}

/**
* @Entity
*/
class SubA extends Root
{
/**
* @Column(type="integer")
*/

### [DDC-1570] GH-243: Add ProxyFactoryInterface to allow custom proxy factories Created: 28/Dec/11  Updated: 23/Dec/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/243 I'd love to have my custom proxy factory used with ORM, which is not possible at the moment (my experimental proxy https://github.com/juzna/doctrine2/commit/7822446036201b066e390b2e182cac1dc0c85430 and some comments about it http://blog.juzna.cz/2011/06/lazy-loading-in-php/)

 Comment by Doctrine Bot [ 23/Dec/13 ] A related Github Pull-Request [GH-243] was closed: https://github.com/doctrine/common/pull/243

### [DDC-1564] MySQL Failure when using setFirstResult() and omitting setMaxResults() Created: 25/Dec/11  Updated: 28/Dec/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.1.4
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Timo A. Hummel Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 When using setFirstResult() and omitting setMaxResults(), MySQL throws an error. This was very confusing for me until I dumped the SQL statements and found out the reason. I know that MySQL doesn't directly support this, their manual says that you should set the second parameter to LIMIT to a very high number (18446744073709551615 in their example). I'd recommend that either throwing an error in the specific platform driver or follow the MySQL example.

 Comment by Benjamin Eberlei [ 28/Dec/11 ] Changed into improvement, i am not sure how this relates to other databases. You can just use this workaround yourself so long.

### [DDC-1552] JTI Owning table for identifier columns could/should be the entitytable Created: 22/Dec/11  Updated: 22/Dec/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Alexander Assignee: Alexander Resolution: Unresolved Votes: 0 Labels: None

 Description
 When ordering a JTI entity on id, the generated SQL will use the table of the root entity. This is because the root entity is listed as owner of the field in the _owningTableMap, leading to non-optimal queries. More information see: https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw

 Comment by Alexander [ 22/Dec/11 ] I can pick this up if it's agreed upon that this could indeed be improved. Comment by Marco Pivetta [ 22/Dec/11 ] The problem here is that joining with a JTI causes LEFT JOINS, which don't perform very well when it comes to sorting the results. Just as a quick reference, here's where "something" should be changed to get this working: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/SqlWalker.php#L316 When the field is part of the primary key, the field used for sorting results should be the one of the table of the entity itself, and not of the root of the CTI.

### [DDC-1553] JTI Joining root tables could include ON ... AND root.id IS NOT NULL for each root in the inheritance Created: 22/Dec/11  Updated: 22/Dec/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Alexander Assignee: Alexander Resolution: Unresolved Votes: 0 Labels: None

 Description
 Would lead to more optimal queries, while still allowing for LEFT JOIN. Also related to this: https://groups.google.com/forum/#!topic/doctrine-user/znkkP7IF_Aw

 Comment by Alexander [ 22/Dec/11 ] Again I can pick this up if this improvement is agreed upon.

### [DDC-1551] postFlush event listeners should be able to get a list of all flushed entities Created: 21/Dec/11  Updated: 23/May/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Albert Casademont Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 9 Labels: None

 Description
 Testing the new Doctrine 2.2 Beta we finally got the postFlush event which is a nice way to handle things after all the DB work has finished. The main problem is that there is no way to get all the flushed entities. In the onFlush event you are able to use the getScheduledEntityUpdates/Inserts/Deletions but as these entities are flushed, those arrays are now empty. To solve this i see 2 aproaches: 1. Not unseting the array that holds the scheduled entities so the getScheduledEntityUpdates/Inserts/Deletions still have data. Those arrays are reset just before finishing the commit method so maybe unsetting them one by one as they are flushed is not necessary 2. Unset the arrays but at the same time, fill another "flushedEntities" array with the flushed entities and then be able to get that array with a getFlushedEntities method I can make a patch if necessary, just wanted to know if that sounds ok before starting it

 Comment by Jasper N. Brouwer [ 23/May/12 ] I agree that Doctrine\ORM\Event\PreFlushEventArgs should contain a record of flushed entities, preferably reachable by entity-insertions/updates/deletions and collection-updates/deletions. I have a project (using Doctrine 2.1) which wrapped the flush call in my own. My flush dispatches custom preFlush/postFlush events (as they didn't exist in Doctrine 2.1), where my postFlushEventArgs does contain such a record. I've just upgraded my project to use Doctrine 2.2 and stumbled upon: Catchable fatal error: Argument 1 passed to Nw\Event\EntityEvent::postFlush() must be an instance of Nw\Event\Args\PostFlushEventArgs, instance of Doctrine\ORM\Event\PostFlushEventArgs given. It seems I've now hooked into Doctrine's postFlush (because I named the events the same way). I have renamed my events to work around this error, but I'd rather see my behavior implemented natively. PS: Using Doctrine 2.2.2 to be precise

### [DDC-1549] GH-232: Recursive check for entity identifiers and hashes Created: 20/Dec/11  Updated: 22/Mar/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Improvement Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/232 Hi all! This PR will add a better support for entities with association keys. getType will check recursively to find a type for the identifier. getIndividualValue will search recursively to find the identifier value trygetById improved, using a recursive function to find an id value instead of implode functions (that cause exceptions if the identifier is an object and do not implements __toString method).

 Comment by Benjamin Eberlei [ 28/Dec/11 ] Mark as improvement Comment by Benjamin Eberlei [ 22/Mar/12 ] A related Github Pull-Request [GH-232] was https://github.com/doctrine/doctrine2/pull/232

### [DDC-1543] Support for Mapping Files on Traits Created: 17/Dec/11  Updated: 17/Dec/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.x
Security Level: All

 Type: New Feature Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 With PHP 5.4 and traits coming we should find a way where you can add xml and yml configurations for a trait and upon loading an entity X, it also loads the trait configuration of this entity.

### [DDC-1538] GH-217: [BUG] Schema Manager had no way to define extra options Created: 14/Dec/11  Updated: 17/Dec/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/217 Schema Manager had no way to define extra options ("comment" option for example). It is possible to add these options via Annotations. After the fix adding @ORM\Column(type="string", options= {"comment" = "test"} ) starts to work producing valid SQL schema with COMMENT output.

### [DDC-1532] PostFlush lifecycle event Created: 13/Dec/11  Updated: 14/Dec/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: None
Security Level: All

 Type: New Feature Priority: Major Reporter: Jack van Galen Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 1 Labels: None

 Description

### [DDC-1513] Missing documentation for using references in Docs Created: 28/Nov/11  Updated: 29/Nov/11

Status: Open
Project: Doctrine 2 - ORM
Component/s: Documentation
Affects Version/s: None
Fix Version/s: None
Security Level: All

 Type: Documentation Priority: Major Reporter: Thomas Gray Assignee: Benjamin Eberlei Resolution: Unresolved Votes: 0 Labels: None

 Description
 I am in the process of switching over from Doctrine 2.0.7 to Doctrine 2.1 and one of the major missing components in my entities was the new use of using the mapping entity. Example:
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2364148497581482, "perplexity": 20474.566197119482}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-35/segments/1408500832738.80/warc/CC-MAIN-20140820021352-00009-ip-10-180-136-8.ec2.internal.warc.gz"}