Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2684

SchemaValidator does not correctly validate association mappings target entities

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      The schema validator checks if the target entity exists and if the target entity is transient. It does so with the following comparison:

      if (!class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity']))

      If I understand this comparison correctly it should evaluate to true if $cmf->isTransient is NOT true because the entity is unknown to the driver in this case. If both the class exists and is a registered entity (is transient) then the association is valid.

        Activity

        Hide
        Marco Pivetta added a comment -

        Jurgen Franse the entity may be transient within a single driver, but not necessarily in the entire class metadata factory

        Show
        Marco Pivetta added a comment - Jurgen Franse the entity may be transient within a single driver, but not necessarily in the entire class metadata factory
        Hide
        Jurgen Franse added a comment -

        The problem was in a custom metadata driver that returned the wrong transient state.

        Show
        Jurgen Franse added a comment - The problem was in a custom metadata driver that returned the wrong transient state.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Jurgen Franse
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: