mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2743: ORM not trowing exception when there is inheritance mapping and type's column's value is missing in discriminator map #3432
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Oct 15, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user cappy:
It will be good to throw exception otherwise I get
Warning: class_parents(): object or string expected in /Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php on line 40
Warning: array_reverse() expects parameter 1 to be array, boolean given in /Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php on line 257
Warning: Invalid argument supplied for foreach() in /Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php on line 257
This check will be good after line 235 in Doctrine\ORM\Internals\Hydration\ObjectHydrator:
if (empty($className)) {
throw HydrationException::emptyDiscriminatorMapValue($dqlAlias);
}
@doctrinebot commented on GitHub (Dec 13, 2013):
Comment created by @beberlei:
This can be validated in the ClassMetadataFactory. If you load a child, it will reverse the order of inheritance and start loading the mappings from the root first. The child is then loaded with the full discriminator map and should throw an error if its not in there.
@doctrinebot commented on GitHub (Dec 14, 2013):
Comment created by cordoval:
i am trying this with the basic group at hackingday