WIP change animator field to animator intern and animator extern

This commit is contained in:
2025-07-01 14:29:01 +02:00
parent e176319775
commit 4c3befe489
4 changed files with 45 additions and 88 deletions

View File

@@ -61,10 +61,16 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
private ?User $moderator = null;
/**
* @var Collection<int, Animator>
* @var Collection<int, User>
*/
#[ORM\OneToMany(mappedBy: 'event', targetEntity: Animator::class)]
private Collection $animators;
#[ORM\OneToMany(mappedBy: 'event', targetEntity: User::class)]
private Collection $animatorsIntern;
/**
* @var Collection<int, ThirdParty>
*/
#[ORM\OneToMany(mappedBy: 'event', targetEntity: ThirdParty::class)]
private Collection $animatorsExtern;
#[Assert\NotBlank]
#[Serializer\Groups(['read'])]
@@ -129,7 +135,8 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
$this->comment = new CommentEmbeddable();
$this->themes = new ArrayCollection();
$this->budgetElements = new ArrayCollection();
$this->animators = new ArrayCollection();
$this->animatorsIntern = new ArrayCollection();
$this->animatorsExtern = new ArrayCollection();
}
public function addBudgetElement(EventBudgetElement $budgetElement)
@@ -187,21 +194,38 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
$this->themes->removeElement($theme);
}
public function getAnimators(): Collection
public function getAnimatorsIntern(): Collection
{
return $this->animators;
return $this->animatorsIntern;
}
public function addAnimator(ThirdParty|User $a): self
public function getAnimatorsExtern(): Collection
{
$this->animators->add($a);
return $this->animatorsExtern;
}
public function addAnimatorIntern(User $ai): self
{
$this->animatorsIntern->add($ai);
return $this;
}
public function removeAnimator(ThirdParty|User $a): void
public function removeAnimatorIntern(User $ai): void
{
$this->animators->removeElement($a);
$this->animatorsIntern->removeElement($ai);
}
public function addAnimatorExtern(User $ae): self
{
$this->animatorsExtern->add($ae);
return $this;
}
public function removeAnimatorExtern(User $ae): void
{
$this->animatorsExtern->removeElement($ae);
}
public function getCenter(): Center