Create internal and external animators

This commit is contained in:
2025-07-02 17:55:00 +02:00
parent 4c3befe489
commit 60d107b541
10 changed files with 113 additions and 200 deletions

View File

@@ -63,13 +63,17 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* @var Collection<int, User>
*/
#[ORM\OneToMany(mappedBy: 'event', targetEntity: User::class)]
#[ORM\ManyToMany(targetEntity: User::class)]
#[Serializer\Groups(['read'])]
#[ORM\JoinTable('chill_event_animatorsintern')]
private Collection $animatorsIntern;
/**
* @var Collection<int, ThirdParty>
*/
#[ORM\OneToMany(mappedBy: 'event', targetEntity: ThirdParty::class)]
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
#[Serializer\Groups(['read'])]
#[ORM\JoinTable('chill_event_animatorsextern')]
private Collection $animatorsExtern;
#[Assert\NotBlank]
@@ -204,26 +208,26 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
return $this->animatorsExtern;
}
public function addAnimatorIntern(User $ai): self
public function addAnimatorsIntern(User $ai): self
{
$this->animatorsIntern->add($ai);
return $this;
}
public function removeAnimatorIntern(User $ai): void
public function removeAnimatorsIntern(User $ai): void
{
$this->animatorsIntern->removeElement($ai);
}
public function addAnimatorExtern(User $ae): self
public function addAnimatorsExtern(ThirdParty $ae): self
{
$this->animatorsExtern->add($ae);
return $this;
}
public function removeAnimatorExtern(User $ae): void
public function removeAnimatorsExtern(ThirdParty $ae): void
{
$this->animatorsExtern->removeElement($ae);
}