Add event theme property to event entity

This commit is contained in:
2025-04-29 10:02:52 +02:00
parent adc9c47d0a
commit e7a1ff1ac8
2 changed files with 65 additions and 8 deletions

View File

@@ -71,6 +71,10 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
#[ORM\ManyToOne(targetEntity: EventType::class)]
private ?EventType $type = null;
#[ORM\ManyToMany(targetEntity: EventTheme::class)]
#[ORM\JoinTable('chill_event_eventtheme')]
private Collection $themes;
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
private CommentEmbeddable $comment;
@@ -96,6 +100,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
$this->participations = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->comment = new CommentEmbeddable();
$this->themes = new ArrayCollection();
}
/**
@@ -126,10 +131,27 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
return $this;
}
public function getThemes(): Collection
{
return $this->themes;
}
public function addTheme(EventTheme $theme): self
{
$this->themes->add($theme);
return $this;
}
public function removeTheme(EventTheme $theme): void
{
$this->themes->removeElement($theme);
}
/**
* @return Center
*/
public function getCenter()
public function getCenter(): ?Center
{
return $this->center;
}
@@ -137,7 +159,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* @return Scope
*/
public function getCircle()
public function getCircle(): ?Scope
{
return $this->circle;
}
@@ -147,7 +169,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
*
* @return \DateTime
*/
public function getDate()
public function getDate(): ?\DateTime
{
return $this->date;
}
@@ -157,7 +179,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -172,7 +194,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
*
* @return string
*/
public function getName()
public function getName(): ?string
{
return $this->name;
}
@@ -202,7 +224,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
*
* @return Scope
*/
public function getScope()
public function getScope(): ?Scope
{
return $this->getCircle();
}
@@ -210,7 +232,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* @return EventType
*/
public function getType()
public function getType(): ?EventType
{
return $this->type;
}
@@ -218,7 +240,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* Remove participation.
*/
public function removeParticipation(Participation $participation)
public function removeParticipation(Participation $participation): void
{
$this->participations->removeElement($participation);
}