Skip to content

Loading…

DDC-1024: the EntityGenerator generate getters and setters for properties of the parent class #1614

Closed
doctrinebot opened this Issue · 6 comments

2 participants

@doctrinebot

Jira issue originally created by user stof:

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.

@doctrinebot

Comment created by @beberlei:

How do you define inheritance?

@doctrinebot

Comment created by stof:

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.

@doctrinebot

Comment created by @beberlei:

fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by yakobe:

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

@doctrinebot

Comment created by albert.brand:

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.

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0.2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.