mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #880] (v2.3.4) corrected inheritance when generating (updating) existing entities #8847
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?
Original Pull Request: https://github.com/doctrine/orm/pull/880
State: closed
Merged: No
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. .