DDC-2743: ORM not trowing exception when there is inheritance mapping and type's column's value is missing in discriminator map #3432

Open
opened 2026-01-22 14:19:50 +01:00 by admin · 2 comments
Owner

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);
}

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); }
admin added the Improvement label 2026-01-22 14:19:50 +01:00
Author
Owner

@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 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.
Author
Owner

@doctrinebot commented on GitHub (Dec 14, 2013):

Comment created by cordoval:

i am trying this with the basic group at hackingday

@doctrinebot commented on GitHub (Dec 14, 2013): Comment created by cordoval: i am trying this with the basic group at hackingday
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3432