[PR #253] [MERGED] enable set visibilty of class fields in EntityGenerator #7923

Closed
opened 2026-01-22 15:57:35 +01:00 by admin · 0 comments
Owner

📋 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: masterHead: protectedfields


📝 Commits (5)

  • facd64e enable set visibilty of class fields in EntityGenerator
  • f26d43b remove whitespace
  • 69f0d70 fix if coding standard
  • 72d5d02 use !== to check field visibility
  • f76d327 use 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.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/253 **Author:** [@mrmkrs](https://github.com/mrmkrs) **Created:** 1/10/2012 **Status:** ✅ Merged **Merged:** 1/28/2012 **Merged by:** [@beberlei](https://github.com/beberlei) **Base:** `master` ← **Head:** `protectedfields` --- ### 📝 Commits (5) - [`facd64e`](https://github.com/doctrine/orm/commit/facd64ef2f0f131149c10799a2b18cc7700f26c0) enable set visibilty of class fields in EntityGenerator - [`f26d43b`](https://github.com/doctrine/orm/commit/f26d43b3eadfbd89d95012430256b4e2d3253a3a) remove whitespace - [`69f0d70`](https://github.com/doctrine/orm/commit/69f0d70a98874695f6fbda353f0d7cf07ccc4917) fix if coding standard - [`72d5d02`](https://github.com/doctrine/orm/commit/72d5d0281a9465ec9cccdf7d555ba7a8edb6a72b) use !== to check field visibility - [`f76d327`](https://github.com/doctrine/orm/commit/f76d3274136874ec84830006823d7e6fdcbea5df) use self:: instead of EntityGenerator:: ### 📊 Changes **2 files changed** (+30 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Tools/EntityGenerator.php` (+28 -2) 📝 `tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php` (+2 -1) </details> ### 📄 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 15:57:35 +01:00
admin closed this issue 2026-01-22 15:57:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7923