Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-3024

Proxy Notice if none of joined tables are primary

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
    • Environment:
      nix* server with php 5.3.x

      Description

      In case of ManyToOne/OneToMany if NONE of joined coloumns are primary it throws a proxy notice:
      NOTICE: Undefined index: id in /vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 121
      Can be replicated this by running:
      $somethings = $em->getRepository('Entities\Something')->findBy(array('productId' => "4"));

      Something entity is ManyToOne to another OneToMany entity, and this productId is primary on NONE of these two entities/tables.

        Activity

        Hide
        Marco Pivetta added a comment -

        As discussed on the mailing list, this issue requires a failing test case to be confirmed.

        Show
        Marco Pivetta added a comment - As discussed on the mailing list, this issue requires a failing test case to be confirmed.
        Hide
        Nima Sadjadi added a comment - - edited

        I am trying to do so Marco, but I am stuck for $metadata thing I said in that thread, as soon as you advice how to fix that, I will be able to run a failing test.

        Show
        Nima Sadjadi added a comment - - edited I am trying to do so Marco, but I am stuck for $metadata thing I said in that thread, as soon as you advice how to fix that, I will be able to run a failing test.
        Hide
        Benjamin Eberlei added a comment -

        not using the primary for the joined columns is not supported and the SchemaValidator already gives an error about that. Runtime checks are not possible here.

        Show
        Benjamin Eberlei added a comment - not using the primary for the joined columns is not supported and the SchemaValidator already gives an error about that. Runtime checks are not possible here.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: