[DDC-265] Possibility for Nested Inheritance Created: 21/Jan/10 Updated: 16/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Michael Fürmann | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
It would be great if Doctrine had the possibility to define a further inharitance in a subclass. Example: I'd like to use a single table inheritance to map all information of |
| Comments |
| Comment by Benjamin Eberlei [ 21/Jan/10 ] |
|
The DataObject you describe is a no-go for Doctrine 2. Its just a very bad practice. Inheritance Mapping is for REAL inheritance only, otherwise you shouldnt go with a relational database in the first place. You should use the Event system for such changes, it offers you roughly the same possibilities and keeps you from having to use inheritance mapping. You could still create an abstract data object and define the fields that will be used in each "implementation" and then in events do something like: if ($entity instanceof DataObject) { $entity->updated(); $archiver->makeSnapshot($entity); } |
| Comment by Jonathan H. Wage [ 20/Mar/10 ] |
|
With this patch I think you could setup a nice similar model where you can introduce new children of this parent class and have it added to the discriminator map from the child instead of having to modify the parents mapping information. |