Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: ORM
-
Security Level: All
-
Labels:None
Description
It would be great if Doctrine had the possibility to define a further inharitance in a subclass.
Example:
There is a class DataObject managing things like created- and lastedit-
timestamps, archiving objects before updates, ...
One of the sub-objects is Content.
There are several types of content.
Written directly to a database field, read from a textfile on server,
executed php file on server, loaded from another server via xmlrpc and
so on.
I'd like to use a single table inheritance to map all information of
the different content objects in one table.
If I understand the model right the only alternate solution would be
to write each single content object to the discriminator map of
DataObject.
Issue Links
- duplicates
-
DDC-138
Allow for mixed inheritance mapping
-
Activity
| Priority | Major [ 3 ] | Minor [ 4 ] |
| Workflow | jira [ 10756 ] | jira-feedback [ 13839 ] |
| Workflow | jira-feedback [ 13839 ] | jira-feedback2 [ 15703 ] |
| Workflow | jira-feedback2 [ 15703 ] | jira-feedback3 [ 17960 ] |
| Priority | Minor [ 4 ] | Major [ 3 ] |
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-265, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
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: