Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2669

YAML mapping: discriminator map exception

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4.1
    • Fix Version/s: None
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:

      Description

      I'm getting this exception when I generate all entities from YAML using orm:generate-entities:

      [Doctrine\ORM\Mapping\MappingException]
      Entity class 'Entity\PersonIndividual' used in the discriminator map of class 'Entity\Person' does not exist.
      

      My discriminator map defined in Entity.Person.dcm.yml:

      discriminatorMap:
        1: PersonIndividual
        2: PersonCompany
        3: PersonSelfEmployed
      

      Mapping driver probably generates entities in wrong order, so entities defined in discriminator map does not exist when entity Person is being generated.

      Note: The easiest workaround is to temporarily remove discriminatorMap definition from entity, generate entities, then put discriminatorMap back and then generate entities again. It would be great if it would be possible to generate all entities in only one step.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Peter Tulala
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: