Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major 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

          Activity

          Michael Fürmann created issue -
          Hide
          Benjamin Eberlei added a comment -

          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);
          }
          
          Show
          Benjamin Eberlei added a comment - 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); }
          Roman S. Borschel made changes -
          Field Original Value New Value
          Link This issue duplicates DDC-138 [ DDC-138 ]
          Roman S. Borschel made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          Hide
          Jonathan H. Wage added a comment -

          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.

          http://www.doctrine-project.org/jira/browse/DDC-447

          Show
          Jonathan H. Wage added a comment - 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. http://www.doctrine-project.org/jira/browse/DDC-447
          Benjamin Eberlei made changes -
          Workflow jira [ 10756 ] jira-feedback [ 13839 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback [ 13839 ] jira-feedback2 [ 15703 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback2 [ 15703 ] jira-feedback3 [ 17960 ]
          Enea Bette made changes -
          Priority Minor [ 4 ] Major [ 3 ]

          This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

          • 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[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

            People

            • Assignee:
              Roman S. Borschel
              Reporter:
              Michael Fürmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: