Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
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
Thanks, fixed in http://github.com/doctrine/mongodb-odm/commit/c12c9239cf152b4764da07b2bc89bfc6967a9569