[DDC-2296] Naming Strategy ORM Entity - plural problem Created: 14/Feb/13  Updated: 14/Mar/13  Resolved: 14/Mar/13

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

Type: Bug Priority: Major
Reporter: keks nicoh Assignee: Benjamin Eberlei
Resolution: Can't Fix Votes: 0
Labels: None


 Description   

We are using Doctringe since 2.2.2.

We the follow relation:

manyToMany:
categories:
targetEntity: \Application\Model\Db\Entity\Category
inversedBy: topics
joinTable:
name: finq_topic_category
joinColumns:
topic_id:
referencedColumnName: id
inverseJoinColumns:
category_id:
referencedColumnName: id

As expected the generated methods in our entities were named like:

addCategory()
getCategories()
...

After we updated to 2.3.2 we got the follow method names:

addCategorie()
getCateogires()

I found in the changelog some notes like "changed naming strategy".
Took us several hours too find out that we had to downgrade back to
2.2.2. Is this a bug or "just" a new behavior?



 Comments   
Comment by Benjamin Eberlei [ 14/Mar/13 ]

Its "just" a new behavior, sadly non BC. The EntityGenerator is really a mess in that regard, because its very hard to test as well. However all the methods are "protected", so you should be able to extend it with your custom entity generator and fixing it.

We are slowly deprecating the EntityGenerator, because this kind of problem and its huge monolithic structure makes it so hard to use and customize.

Generated at Mon Apr 21 05:32:31 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.