mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #253] [MERGED] enable set visibilty of class fields in EntityGenerator #7923
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?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/253
Author: @mrmkrs
Created: 1/10/2012
Status: ✅ Merged
Merged: 1/28/2012
Merged by: @beberlei
Base:
master← Head:protectedfields📝 Commits (5)
facd64eenable set visibilty of class fields in EntityGeneratorf26d43bremove whitespace69f0d70fix if coding standard72d5d02use !== to check field visibilityf76d327use self:: instead of EntityGenerator::📊 Changes
2 files changed (+30 additions, -3 deletions)
View changed files
📝
lib/Doctrine/ORM/Tools/EntityGenerator.php(+28 -2)📝
tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php(+2 -1)📄 Description
This commit makes it possible to set the field visibility to private or protected of the generated entities (generated with EntityGenerator).
For example: One can then generate a "DefaultUser" class with protected fields, and subclass it. (Class User extends DefaultUser). That way you can regenerate the entities with Doctrine over and over again without interfering with additional developer code.
Also, some project codingstandards say "protected over private" so all entities should have protected fields so they can always be extended.
See: groups.google.com/group/doctrine-user/browse_thread/thread/77609f754ddea7de/051cfdbdf2cfaa03
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.