diff --git a/DataFixtures/ORM/LoadParticipation.php b/DataFixtures/ORM/LoadParticipation.php index 618b44d7c..98f19a82e 100644 --- a/DataFixtures/ORM/LoadParticipation.php +++ b/DataFixtures/ORM/LoadParticipation.php @@ -8,6 +8,7 @@ use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Chill\EventBundle\Entity\Participation; use Chill\MainBundle\Entity\Center; use Chill\EventBundle\Entity\Event; +use Chill\MainBundle\DataFixtures\ORM\LoadScopes; /** * Load Events and Participation @@ -82,6 +83,11 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa ->setLabel($this->faker->words(rand(2,4), true)) ->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)])) ->setCenter($center) + ->setCircle( + $this->getReference( + LoadScopes::$references[array_rand(LoadScopes::$references)] + ) + ) ; $manager->persist($event); $events[] = $event; diff --git a/Entity/Event.php b/Entity/Event.php index ec8c16f43..763f27f56 100644 --- a/Entity/Event.php +++ b/Entity/Event.php @@ -34,6 +34,12 @@ class Event */ private $type; + /** + * + * @var \Chill\MainBundle\Entity\Scope + */ + private $circle; + /** * @var \Doctrine\Common\Collections\Collection */ @@ -141,7 +147,38 @@ class Event { return $this->center; } + + /** + * + * @return \Chill\MainBundle\Entity\Scope + */ + public function getCircle() + { + return $this->circle; + } + /** + * + * @param \Chill\MainBundle\Entity\Scope $circle + * @return \Chill\EventBundle\Entity\Event + */ + public function setCircle(\Chill\MainBundle\Entity\Scope $circle) + { + $this->circle = $circle; + return $this; + } + + /** + * + * @deprecated + * @return \Chill\MainBundle\Entity\Scope + */ + public function getScope() + { + return $this->getCircle(); + } + + /** * Add participation * diff --git a/Resources/config/doctrine/Event.orm.yml b/Resources/config/doctrine/Event.orm.yml index b4325981c..ae69e2f06 100644 --- a/Resources/config/doctrine/Event.orm.yml +++ b/Resources/config/doctrine/Event.orm.yml @@ -22,4 +22,6 @@ Chill\EventBundle\Entity\Event: targetEntity: Chill\MainBundle\Entity\Center type: targetEntity: Chill\EventBundle\Entity\EventType + circle: + targetEntity: Chill\MainBundle\Entity\Scope lifecycleCallbacks: { }