participations = new ArrayCollection(); } /** * Add participation. * * @return Event */ public function addParticipation(Participation $participation) { $this->participations[] = $participation; return $this; } /** * @return Center */ public function getCenter() { return $this->center; } /** * @return Scope */ public function getCircle() { return $this->circle; } /** * Get date. * * @return DateTime */ public function getDate() { return $this->date; } /** * Get id. * * @return int */ public function getId() { return $this->id; } /** * @return int */ public function getModerator() { return $this->moderator; } /** * Get label. * * @return string */ public function getName() { return $this->name; } /** * @return ArrayIterator|Collection|Traversable */ public function getParticipations() { return $this->getParticipationsOrdered(); } /** * Sort Collection of Participations. * * @return ArrayIterator|Traversable */ public function getParticipationsOrdered() { $iterator = $this->participations->getIterator(); $iterator->uasort(static fn ($first, $second) => strnatcasecmp($first->getPerson()->getFirstName(), $second->getPerson()->getFirstName())); return $iterator; } /** * @deprecated * * @return Scope */ public function getScope() { return $this->getCircle(); } /** * @return EventType */ public function getType() { return $this->type; } /** * Remove participation. */ public function removeParticipation(Participation $participation) { $this->participations->removeElement($participation); } /** * @return $this */ public function setCenter(Center $center) { $this->center = $center; return $this; } /** * @return $this */ public function setCircle(Scope $circle) { $this->circle = $circle; return $this; } /** * Set date. * * @return Event */ public function setDate(DateTime $date) { $this->date = $date; return $this; } /** * @param int $moderator * * @return Event */ public function setModerator($moderator) { $this->moderator = $moderator; return $this; } /** * Set label. * * @param string $label * * @return Event */ public function setName($label) { $this->name = $label; return $this; } /** * @return $this */ public function setType(EventType $type) { $this->type = $type; return $this; } }