[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


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();

$a->setB(new ArrayCollection(array('test')));

Getting PHP warning:

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

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

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

Generated at Fri Sep 04 06:29:23 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.