[MODM-62] PHP warning when array is replaced with ArrayCollection: array_udiff_assoc(): Argument #2 is not an array Created: 28/Aug/10  Updated: 30/Aug/10  Resolved: 30/Aug/10

Status: Resolved
Project: Doctrine MongoDB ODM
Component/s: Persister
Affects Version/s: None
Fix Version/s: 1.0.0BETA2

Type: Bug Priority: Major
Reporter: Vladimir Razuvaev Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
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


 Comments   
Comment by Jonathan H. Wage [ 30/Aug/10 ]

Thanks, fixed in http://github.com/doctrine/mongodb-odm/commit/c12c9239cf152b4764da07b2bc89bfc6967a9569

Generated at Fri Oct 24 15:27:51 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.