setEmail( 'tktest@tktest.com' ) ->setPseudo( 'tk_TEST' ); // $product = new Product(); $poll = new Poll(); $poll->setTitle( 'démo sondage de texte' ); $poll->setKind( 'text' ); $poll->setDescription( 'description du sondage' ); $poll->setAdminKey( 'dskjfsfdljkdsjlkdsfkjdsjdlkfs' ); $poll->setModificationPolicy( 'nobody' ); $poll->setCreationDate( new \DateTime() ); $poll->setExpiracyDate( new \DateTime() ); $poll->setMailOnVote( true ); $poll->setOwner( $owner ); $owner->addPoll( $poll ); $manager->persist( $poll ); $poll = new Poll(); $poll->setTitle( 'démo sondage de texte 2' ); $poll->setDescription( 'description du sondage 2' ); $poll->setKind( 'date' ); $poll->setAdminKey( 'dskjfsfdljkdsjlkdsfkjdsjdlkfs' ); $poll->setModificationPolicy( 'self' ); $poll->setMailOnComment( true ); $poll->setCreationDate( new \DateTime() ); $poll->setExpiracyDate( new \DateTime() ); $poll->setOwner( $owner ); $owner->addPoll( $poll ); $manager->persist( $poll ); $poll = new Poll(); $poll->setTitle( 'accès restreint sondage de texte' ); $poll->setKind( 'text' ); $poll->setPassword( md5( 'mot_de_passe_super' ) ); $poll->setModificationPolicy( 'everybody' ); $poll->setDescription( 'description du sondage' ); $poll->setAdminKey( 'dskjfsfdljkdsjlkdsfkjdsjdlkfs' ); $poll->setCreationDate( new \DateTime() ); $poll->setExpiracyDate( new \DateTime() ); $poll->setMailOnComment( true ); $poll->setMailOnVote( true ); $poll->setOwner( $owner ); $owner->addPoll( $poll ); $manager->persist( $poll ); $manager->persist( $owner ); $manager->flush(); } }