Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2296

Naming Strategy ORM Entity - plural problem

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Can't Fix
    • Affects Version/s: 2.3.2
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • 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?

        Activity

        Hide
        Benjamin Eberlei added a comment -

        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.

        Show
        Benjamin Eberlei added a comment - 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.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            keks nicoh
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: