Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-2743

ORM not trowing exception when there is inheritance mapping and type's column's value is missing in discriminator map

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.3.1, 2.3.2, 2.3.3, 2.3.4
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

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

        Activity

        Hide
        beberlei Benjamin Eberlei added a comment -

        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.

        Show
        beberlei Benjamin Eberlei added a comment - 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.
        Hide
        cordoval Luis Cordova added a comment -

        i am trying this with the basic group at hackingday

        Show
        cordoval Luis Cordova added a comment - i am trying this with the basic group at hackingday

          People

          • Assignee:
            beberlei Benjamin Eberlei
            Reporter:
            cappy Bojidar Hristov
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: