Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2034

getPartialReference returns partial entities for non existent entities

    Details

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

      Description

      $variant = $em->getPartialReference('Entity\Variant', -1);
      echo $variant->getVariantId();
      

      prints -1. Is it an expected behavior or a bug? Shouldn't a check be made to prevent creating new instances for ids that do not exist?

        Activity

        Oleg Namaka created issue -
        Oleg Namaka made changes -
        Field Original Value New Value
        Description {code}
        $variant = $em->getPartialReference('Entity\Variant', -1);
        echo $variant->getVariantId();
        {code}

        prints -1. Is it an expected behavior or a bug?
        {code}
        $variant = $em->getPartialReference('Entity\Variant', -1);
        echo $variant->getVariantId();
        {code}

        prints -1. Is it an expected behavior or a bug? Shouldn't a check be made to prevent creating new instances for ids that do not exist?
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Oleg Namaka
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: