Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1024

the EntityGenerator generate getters and setters for properties of the parent class

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Git Master
    • Fix Version/s: 2.0.2, 2.1
    • Component/s: Tools
    • Security Level: All
    • Labels:
      None

      Description

      when using the EntityGenerator to generate getters and setters of two classes mapped with annotations, one inheriting from the other, the EntityGenerator generates getters and setters for the properties of the parent class in the child class too. This occurs since the recent EntityGenerator changes (as it did not care about inheritance before).
      I suppose this is due to the fact that the getters and setters of the parent class are not yet generated when handling the child class.

      I haven't try if it works well when using XML or YAML for the mapping.

        Activity

        Hide
        Albert Brand added a comment -

        I'm also still seeing this in 2.1 (bundled with Symfony2).
        Using single table inheritance, adding a protected or public property to the abstract class causes private properties & getters & setters to be added to all subclasses.

        Show
        Albert Brand added a comment - I'm also still seeing this in 2.1 (bundled with Symfony2). Using single table inheritance, adding a protected or public property to the abstract class causes private properties & getters & setters to be added to all subclasses.
        Hide
        yakobe added a comment -

        I am still having this problem with the 2.1 branch. Should it not happen anymore?

        Show
        yakobe added a comment - I am still having this problem with the 2.1 branch. Should it not happen anymore?
        Hide
        Benjamin Eberlei added a comment -

        fixed

        Show
        Benjamin Eberlei added a comment - fixed
        Hide
        Christophe Coevoet added a comment -

        In my case, it was inheritance using a Single Table Inheritance.

        Both entities were in the same Symfony2 Bundle so the getters and setters were generated by the same command.

        Show
        Christophe Coevoet added a comment - In my case, it was inheritance using a Single Table Inheritance. Both entities were in the same Symfony2 Bundle so the getters and setters were generated by the same command.
        Hide
        Benjamin Eberlei added a comment -

        How do you define inheritance?

        Show
        Benjamin Eberlei added a comment - How do you define inheritance?

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Christophe Coevoet
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: