Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1939

Trying to save ManyToMany relatrionship

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2.3, 2.3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      When i try to save a many to many relationship i have to following error

      Fatal error: Call to a member function getOwner() on a non-object in Doctrine/ORM/Persisters/ManyToManyPersister.php on line 181

      It tries to call getOwner on the following array ($mapping)

      array(19) {
      ["fieldName"] => string(10) "privileges"
      ["joinTable"] => array(4) {
      ["name"] => string(36) "fsbackend.user_mch_account_privilege"
      ["schema"] => NULL
      ["joinColumns"] => array(2) {
      [0] => array(6)

      { ["name"] => string(13) "mch_accountid" ["referencedColumnName"] => string(13) "mch_accountid" ["unique"] => bool(false) ["nullable"] => bool(true) ["onDelete"] => NULL ["columnDefinition"] => NULL }

      [1] => array(6)

      { ["name"] => string(3) "uid" ["referencedColumnName"] => string(3) "uid" ["unique"] => bool(false) ["nullable"] => bool(true) ["onDelete"] => NULL ["columnDefinition"] => NULL }

      }
      ["inverseJoinColumns"] => array(1) {
      [0] => array(6)

      { ["name"] => string(10) "resourceid" ["referencedColumnName"] => string(10) "resourceid" ["unique"] => bool(false) ["nullable"] => bool(true) ["onDelete"] => NULL ["columnDefinition"] => NULL }

      }
      }
      ["targetEntity"] => string(21) "Entity\User\Privilege"
      ["mappedBy"] => NULL
      ["inversedBy"] => NULL
      ["cascade"] => array(0) {
      }
      ["indexBy"] => string(10) "resourceid"
      ["fetch"] => int(2)
      ["type"] => int(8)
      ["isOwningSide"] => bool(true)
      ["sourceEntity"] => string(26) "Entity\Merchant\Membership"
      ["isCascadeRemove"] => bool(false)
      ["isCascadePersist"] => bool(false)
      ["isCascadeRefresh"] => bool(false)
      ["isCascadeMerge"] => bool(false)
      ["isCascadeDetach"] => bool(false)
      ["relationToSourceKeyColumns"] => array(2)

      { ["mch_accountid"] => string(13) "mch_accountid" ["uid"] => string(3) "uid" }

      ["joinTableColumns"] => array(3)

      { [0] => string(13) "mch_accountid" [1] => string(3) "uid" [2] => string(10) "resourceid" }

      ["relationToTargetKeyColumns"] => array(1)

      { ["resourceid"] => string(10) "resourceid" }

      }

      1. Membership.php
        0.9 kB
        Jeremie Tom tom
      2. Privileges.php
        0.3 kB
        Jeremie Tom tom
      3. UserAccount.php
        0.6 kB
        Jeremie Tom tom

        Activity

        Jeremie Tom tom created issue -
        Marco Pivetta made changes -
        Field Original Value New Value
        Assignee Benjamin Eberlei [ beberlei ] Marco Pivetta [ ocramius ]
        Jeremie Tom tom made changes -
        Attachment Membership.php [ 11210 ]
        Attachment UserAccount.php [ 11211 ]
        Attachment Privileges.php [ 11212 ]
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2.3 [ 10196 ]
        Fix Version/s 2.3 [ 10185 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Jeremie Tom tom
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: