public function load(ObjectManager $manager)
 {
     $group = $this->getReference('group');
     $petition = new GroupPetition();
     $petition->setUser($group);
     $petition->setPetitionBody('test');
     $petition->setPetitionTitle('test');
     $this->addReference('groupPetition1', $petition);
     $manager->persist($petition);
     //outsider sign petition
     $publicPetition = new GroupPetition();
     $publicPetition->setUser($group);
     $publicPetition->setPetitionBody('test');
     $publicPetition->setPetitionTitle('test_public');
     $publicPetition->setIsOutsidersSign(true);
     $this->addReference('groupPublicPetition1', $publicPetition);
     $manager->persist($publicPetition);
     //published
     $petitionPublished = new GroupPetition();
     $petitionPublished->setUser($group);
     $petitionPublished->setPetitionBody('testPublish');
     $petitionPublished->setPetitionTitle('testPublish');
     $petitionPublished->setPublishedAt(new \DateTime());
     $this->addReference('groupPetitionPublished1', $petitionPublished);
     $manager->persist($petitionPublished);
     $manager->flush();
 }
 public function load(ObjectManager $manager)
 {
     $petition = new GroupPetition();
     $petition->setPetitionTitle('Petition title');
     $petition->setPetitionBody('Petition body');
     $petition->setUser($this->getReference('group-group1'));
     $petition->setPublishedAt(new \DateTime('now'));
     $option = new Option();
     $option->setQuestion($petition)->setValue('sign');
     $this->addReference('petition1', $petition);
     $this->addReference('petition-option1', $option);
     $manager->persist($option);
     $manager->persist($petition);
     $manager->flush();
 }
 public function setUser(\Civix\CoreBundle\Entity\Group $user = NULL)
 {
     $this->__load();
     return parent::setUser($user);
 }