*/ #[ORM\OneToMany(mappedBy: 'project', targetEntity: Reward::class)] private Collection $rewards; /** * @var Collection */ #[ORM\OneToMany(mappedBy: 'project', targetEntity: MatchCallSubmission::class)] private Collection $matchCallSubmissions; public function __construct() { $this->accounting = Accounting::of($this); $this->rewards = new ArrayCollection(); $this->matchCallSubmissions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function setId(int $id): static { $this->id = $id; return $this; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): static { $this->title = $title; return $this; } public function getAccounting(): ?Accounting { return $this->accounting; } public function setAccounting(?Accounting $accounting): static { $this->accounting = $accounting; return $this; } public function getOwner(): ?User { return $this->owner; } public function isOwnedBy(User $user): bool { return $user->getId() === $this->owner->getId(); } public function setOwner(?User $owner): static { $this->owner = $owner; return $this; } public function getStatus(): ProjectStatus { return $this->status; } public function setStatus(ProjectStatus $status): static { $this->status = $status; return $this; } /** * @return Collection */ public function getRewards(): Collection { return $this->rewards; } public function addReward(Reward $reward): static { if (!$this->rewards->contains($reward)) { $this->rewards->add($reward); $reward->setProject($this); } return $this; } public function removeReward(Reward $reward): static { if ($this->rewards->removeElement($reward)) { // set the owning side to null (unless already changed) if ($reward->getProject() === $this) { $reward->setProject(null); } } return $this; } /** * @return Collection */ public function getMatchCallSubmissions(): Collection { return $this->matchCallSubmissions; } public function addMatchCallSubmission(MatchCallSubmission $MatchCallSubmission): static { if (!$this->matchCallSubmissions->contains($MatchCallSubmission)) { $this->matchCallSubmissions->add($MatchCallSubmission); $MatchCallSubmission->setProject($this); } return $this; } public function removeMatchCallSubmission(MatchCallSubmission $MatchCallSubmission): static { if ($this->matchCallSubmissions->removeElement($MatchCallSubmission)) { // set the owning side to null (unless already changed) if ($MatchCallSubmission->getProject() === $this) { $MatchCallSubmission->setProject(null); } } return $this; } }