mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2860: [GH-880] (v2.3.4) corrected inheritance when generating (updating) existing entities #3571
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Dec 16, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user @doctrinebot:
This issue is created automatically through a Github pull request on behalf of peetersdiet:
Url: https://github.com/doctrine/doctrine2/pull/880
Message:
I have modified the EntityGenerator-class so the script to generate entities takes inheritance of existing entities into account when generating getters and setters. This will only affect existing entities, not newly created.
The command 'orm:generate-entities' (and related symfony2 command 'doctrine:generate:entities') will now generate properties and methods in existing entitities that will not clash with those higher in the inheritance-chain. This effectively fixes the errors like 'PHP Fatal error: Access level to ... must be (protected|private|public) ...' after running the generate-entities command.
Basic rules added for updating existing entities if a property|method is found higher up the hierarchy:
I have tested this with the command 'doctrine:generate:entities' on Symfony 2.3 with doctrine/orm v2.3.4. .
Edit: I seem to have referenced the wrong branch when creating the pull request. I branched from tag 2.3.4 .
@doctrinebot commented on GitHub (Jan 2, 2014):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-880] was closed:
https://github.com/doctrine/doctrine2/pull/880
@doctrinebot commented on GitHub (Jan 2, 2014):
Issue was closed with resolution "Invalid"