Task #27283

Handle @InheritanceType in a correct manner

Added by Rens Admiraal about 4 years ago. Updated over 2 years ago.

Status:Resolved Start date:2011-06-07
Priority:Should have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 2.0 beta 1
Sprint: Has patch:No
PHP Version: Complexity:

Description

If a model is extended the base class needs to be annotated with InheritanceType. Problem is that we don't know which classes will ever be extended, and Doctrine throws an error when the InheritanceType is set without discriminator map:

Uncaught Exception in FLOW3 Entity class 'F3\FLOW3\Security\Account' is using inheritance but no discriminator map was defined. thrown in file .../ORM/Mapping/MappingException.php in line 202

In such cases the annotation must be ignored by our annotation driver, or the IneritanceType should be set automagically if FLOW3 detects that a model is extended.

Relates to: https://review.typo3.org/#change,2130


Related issues

related to TYPO3.Flow - Feature #37372: Inheritance in ORM should be configured automatically Accepted 2012-05-21

Associated revisions

Revision f08339dc
Added by Karsten Dambekalns over 2 years ago

[TASK] Handle InheritanceType annotation more robust

When specifying InheritanceType but no heirs exist, no longer
an exception will be thrown. Instead inheritance will be disabled
to allow specifying InheritanceType "for future use".

Change-Id: I113a2263433f50344d19ee750c3438467d54109e
Resolves: #27283
Releases: 1.2

History

#1 Updated by Rens Admiraal about 4 years ago

  • Category set to Persistence

#2 Updated by Karsten Dambekalns over 3 years ago

  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns
  • Target version set to 1.1
  • Has patch set to No

#3 Updated by Karsten Dambekalns over 3 years ago

This works for non-abstract base classes since the merge of https://review.typo3.org/2277 (as the discriminator map is always defined).

#4 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10893

#5 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10893

#6 Updated by Karsten Dambekalns about 3 years ago

  • Target version changed from 1.1 to 1.1 beta 2

#7 Updated by Karsten Dambekalns about 3 years ago

  • Target version changed from 1.1 beta 2 to 2.0 beta 1

#8 Updated by Gerrit Code Review about 3 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10893

#9 Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10893

#10 Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10893

#11 Updated by Karsten Dambekalns over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF