WIP change animator field

This commit is contained in:
2025-06-19 13:35:17 +02:00
parent 5d810b4230
commit e176319775
7 changed files with 272 additions and 14 deletions

View File

@@ -61,11 +61,9 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
private ?User $moderator = null;
/**
* @var Collection<int, ThirdParty>
* @var Collection<int, Animator>
*/
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
#[Serializer\Groups(['read'])]
#[ORM\JoinTable('chill_event_thirdparty')]
#[ORM\OneToMany(mappedBy: 'event', targetEntity: Animator::class)]
private Collection $animators;
#[Assert\NotBlank]
@@ -194,16 +192,16 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
return $this->animators;
}
public function addAnimator(ThirdParty $tp): self
public function addAnimator(ThirdParty|User $a): self
{
$this->animators->add($tp);
$this->animators->add($a);
return $this;
}
public function removeAnimator(ThirdParty $tp): void
public function removeAnimator(ThirdParty|User $a): void
{
$this->animators->removeElement($tp);
$this->animators->removeElement($a);
}
public function getCenter(): Center