DDC-2184: [GH-530] Singular form of generated methods should end with 'y' when property ends with 'ies' #2877

doctrinebot opened this Issue Dec 4, 2012 · 5 comments

2 participants


Jira issue originally created by user @beberlei:

In Doctrine 2.3 the 'add' and 'remove' methods in oneToMany associations have another problem (in earlier versions like 2.2 this worked correct). The singular form is not correctly detected if the property ends with 'ies' like 'entries' which should be transformed to 'entry'.
I have this YAML definition:

  type: entity
      id: true
      type: integer
      unsigned: false
      nullable: false
        strategy: IDENTITY
      targetEntity: Entry
      mappedBy: archive

This generates these methods:

public function addEntrie(\Entry $entries) { ... }
public function removeEntrie(\Entry $entries) { ... }

Because in the EntityGenerator only the plural 's' is removed. It would be nice if an ending of 'ies' could be replaced by 'y'. So that we get these methods

public function addEntry(\Entry $entries) { ... }
public function removeEntry(\Entry $entries) { ... }

My fork already has the changes naitsirch@a3adfcc
I have opened a pull request here #530


Comment created by naitsirch:

Sorry, I accidently clicked on the button 'Request Feedback' :-(
Now the status has changed to 'Awaiting Feedback'


Comment created by @beberlei:

Mark as improvement


Comment created by stockopede:

Is this issue going to be resolved? It's a major problem for our project - a stock market application that uses properties like 'securities' and entities of name 'Security'.


Comment created by @doctrinebot:

A related Github Pull-Request [GH-530] was closed:

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment