2

I have a problem when i want persist my clone document. The clone is ok but when i persist a document i lose the referenceMany. Why? All variable are persist except the variable with @MongoDB\ReferenceMany is skip.

/**
 * @MongoDB\Document
 */
class Notice{

    /**
     * @MongoDB\String
     */
    protected $idPatern = '';

    /**
     * @MongoDB\ReferenceOne(
     *      targetDocument="Wikiludo\NoticeBundle\Document\NombreJoueur",
     *      cascade="all"
     * )
     */
    protected $nombreJoueur;

    /**
     * @MongoDB\ReferenceMany(
     *      targetDocument="Wikiludo\NoticeBundle\Document\NoteSurPublic",
     *      cascade="all"
     * )
     */
    protected $noteSurPublics;

    public function __clone() {
        if ($this->id) {
            $this->setId(null);
        }
    }
    [...]

}
vinzcoco
  • 89
  • 1
  • 9

0 Answers0