doctrine:generate:entities regenerates privates for abstract or traits #106

Closed
jsgoupil opened this Issue Sep 7, 2012 · 12 comments

Comments

Projects
None yet
8 participants
@jsgoupil

jsgoupil commented Sep 7, 2012

Using traits (PHP5.4) or abstract class as parent will not generate the correct result when calling
doctrine:generate:entities

abstract class Address {
    /**
     * @ORM\Column(type="string", length=255)
     **/
    protected $firstname;

    public function setFirstName() ...
    public function getFirstName() ...
}

class Customer extends Address {

    // will generate this:
    private $firstname;

    public function setFirstName() ...
    public function getFirstName() ...
}  

The private should not be generated neither the public methods since they exist in the base class.
The same kind of thing happens when using trait.

@stof

This comment has been minimized.

Show comment Hide comment
@stof

stof Sep 7, 2012

Member

@jsgoupil when you opened it on symfony yesterday, I asked you to report it to the doctrine ORM, not to the doctrine bundle. The EntityGenerator is not part of DoctrineBundle either

Member

stof commented Sep 7, 2012

@jsgoupil when you opened it on symfony yesterday, I asked you to report it to the doctrine ORM, not to the doctrine bundle. The EntityGenerator is not part of DoctrineBundle either

@jsgoupil

This comment has been minimized.

Show comment Hide comment
@jsgoupil

jsgoupil Sep 7, 2012

@stof Well well sorry not being that proficient in Symfony, I looked up where the call was then looked up on packagist.org ...

I think you guys can take care of it and transfer it now...

jsgoupil commented Sep 7, 2012

@stof Well well sorry not being that proficient in Symfony, I looked up where the call was then looked up on packagist.org ...

I think you guys can take care of it and transfer it now...

@SalmanPK

This comment has been minimized.

Show comment Hide comment
@SalmanPK

SalmanPK Nov 13, 2012

Please fix this. Such basic bugs.. doesn't look like you guys ever eat your own dog food.

Please fix this. Such basic bugs.. doesn't look like you guys ever eat your own dog food.

@lsmith77

This comment has been minimized.

Show comment Hide comment
@lsmith77

lsmith77 Nov 13, 2012

Member

huh? how about you fix it then!

Member

lsmith77 commented Nov 13, 2012

huh? how about you fix it then!

@stof

This comment has been minimized.

Show comment Hide comment
@stof

stof Nov 15, 2012

Member

@SalmanPK Most Doctrine devs are indeed not using the code generation. the EntityGenerator has never been considered as a first-class citizen in Doctrine2 but only as an helper.

Thus, this issue should be reported to the Doctrine ORM project (which is where the generator is defined) instead of in the bundle (where we cannot do anything about it as we simply call the generator)

Member

stof commented Nov 15, 2012

@SalmanPK Most Doctrine devs are indeed not using the code generation. the EntityGenerator has never been considered as a first-class citizen in Doctrine2 but only as an helper.

Thus, this issue should be reported to the Doctrine ORM project (which is where the generator is defined) instead of in the bundle (where we cannot do anything about it as we simply call the generator)

@giorrrgio

This comment has been minimized.

Show comment Hide comment
@giorrrgio

giorrrgio Nov 17, 2012

@jsgoupil and @SalmanPK I think you're having an issue on understanding how open source software works, not an issue with the DoctrineBundle itself. Try to reconsider your points. That's IMHO, no offense.

@jsgoupil and @SalmanPK I think you're having an issue on understanding how open source software works, not an issue with the DoctrineBundle itself. Try to reconsider your points. That's IMHO, no offense.

@hades200082

This comment has been minimized.

Show comment Hide comment
@hades200082

hades200082 Nov 17, 2012

Man you guys are way more patient than I would be. I'd have closed this issue as "invalid" or "not a bug" with a link to where he actually needs to report it and moved on by now lol

Man you guys are way more patient than I would be. I'd have closed this issue as "invalid" or "not a bug" with a link to where he actually needs to report it and moved on by now lol

@lsmith77

This comment has been minimized.

Show comment Hide comment
@lsmith77

lsmith77 Nov 17, 2012

Member

its important to try and stay solution oriented .. in that way @stof's reply was much better than mine. if we as a community act civil, it will be the best way to encourage others to act the same way.

Member

lsmith77 commented Nov 17, 2012

its important to try and stay solution oriented .. in that way @stof's reply was much better than mine. if we as a community act civil, it will be the best way to encourage others to act the same way.

@hjr3

This comment has been minimized.

Show comment Hide comment
@hjr3

hjr3 Nov 17, 2012

Hi @jsgoupil ,

Thank you for taking the time to report this. @stof wanted the bug report opened here: http://www.doctrine-project.org/jira/browse/DDC so it could be tracked better. I know you already re-opened this once. If you need help, just ping me and I can open it on your behalf.

hjr3 commented Nov 17, 2012

Hi @jsgoupil ,

Thank you for taking the time to report this. @stof wanted the bug report opened here: http://www.doctrine-project.org/jira/browse/DDC so it could be tracked better. I know you already re-opened this once. If you need help, just ping me and I can open it on your behalf.

@beberlei

This comment has been minimized.

Show comment Hide comment
@beberlei

beberlei Nov 18, 2012

Owner

I opened a ticket on DDC here: http://www.doctrine-project.org/jira/browse/DDC-2154

In general all the core contributors use Doctrine in their work projects. That doesn't mean that we use some use case or feature, for example the EntityGenerator in combination with Traits. It is very special.

As we have day jobs, you can always help by opening Pull Requests. But I know that you having day jobs as well, fixing something on an open source project isn't always possible.

Owner

beberlei commented Nov 18, 2012

I opened a ticket on DDC here: http://www.doctrine-project.org/jira/browse/DDC-2154

In general all the core contributors use Doctrine in their work projects. That doesn't mean that we use some use case or feature, for example the EntityGenerator in combination with Traits. It is very special.

As we have day jobs, you can always help by opening Pull Requests. But I know that you having day jobs as well, fixing something on an open source project isn't always possible.

@beberlei beberlei closed this Nov 18, 2012

@SalmanPK

This comment has been minimized.

Show comment Hide comment
@SalmanPK

SalmanPK Nov 19, 2012

Thanks a lot everyone. To be clear: I was not using any abstract classes or traits, just plain old inheritance.

Sorry if I came off as mean, was a bit frustrated because of a deadline. I wont be sticking with PHP If it wasn't for the great work you guys have done which I really appreciate and inspires me. idk why I have to hit a few bugs every single project.. just bad luck :)

@giorrrgio You're right. Lazy me. I thought I'd have to understand how the EntityGenerator class works and create a test case for reporting a doctrine bug (here we can just say that the command is broken heh) and I was short on time at the moment. I don't know how this accounts for my understanding of open source software as a whole though.

Thanks a lot everyone. To be clear: I was not using any abstract classes or traits, just plain old inheritance.

Sorry if I came off as mean, was a bit frustrated because of a deadline. I wont be sticking with PHP If it wasn't for the great work you guys have done which I really appreciate and inspires me. idk why I have to hit a few bugs every single project.. just bad luck :)

@giorrrgio You're right. Lazy me. I thought I'd have to understand how the EntityGenerator class works and create a test case for reporting a doctrine bug (here we can just say that the command is broken heh) and I was short on time at the moment. I don't know how this accounts for my understanding of open source software as a whole though.

@giorrrgio

This comment has been minimized.

Show comment Hide comment
@giorrrgio

giorrrgio Nov 19, 2012

@SalmanPK I think your own last post makes the point even clearer: your comment ("Such basic bugs.. doesn't look like you guys ever eat your own dog food") was not useful for solving the problem, and a bit offending for those who gives their free time to OSS development. Opening an issue without writing tests is always okay, making a pull request with tests is always great, unhelping complains like that are always bad. I know that working with deadlines and broken vendor dependencies or broken vendor commits is very frustrating, it happens often here too. But please try to stick to your last post's constructive intent next time ;-)

@SalmanPK I think your own last post makes the point even clearer: your comment ("Such basic bugs.. doesn't look like you guys ever eat your own dog food") was not useful for solving the problem, and a bit offending for those who gives their free time to OSS development. Opening an issue without writing tests is always okay, making a pull request with tests is always great, unhelping complains like that are always bad. I know that working with deadlines and broken vendor dependencies or broken vendor commits is very frustrating, it happens often here too. But please try to stick to your last post's constructive intent next time ;-)

@doctrinebot doctrinebot referenced this issue in doctrine/doctrine2 Dec 6, 2015

Closed

DDC-2154: Traits and Code Generation #2844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment