Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-62

PHP warning when array is replaced with ArrayCollection: array_udiff_assoc(): Argument #2 is not an array

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0BETA2
    • Component/s: Persister
    • Labels:
      None

      Description

      Simple test case to reproduce:

      /** @Document(db="tests", collection="tests") */
      class a {
          /** @Id */
          protected $id;
      
          /** @Collection */
          protected $b = array('test');
      
          function setB($b) {$this->b = $b;}
      }
      
      $a = new a();
      $dm->persist($a);
      $dm->flush();
      $dm->refresh($a);
      
      $a->setB(new ArrayCollection(array('test')));
      $dm->persist($a);
      $dm->flush();
      

      Getting PHP warning:

      PHP Warning:  array_udiff_assoc(): Argument #2 is not an array in Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister.php on line 458
      

        Activity

        Show
        Jonathan H. Wage added a comment - Thanks, fixed in http://github.com/doctrine/mongodb-odm/commit/c12c9239cf152b4764da07b2bc89bfc6967a9569

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Vladimir Razuvaev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: