children = new ArrayCollection(); $this->goals = new ArrayCollection(); $this->results = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getDesactivationDate(): ?\DateTimeInterface { return $this->desactivationDate; } public function setDesactivationDate(?\DateTimeInterface $desactivationDate): self { $this->desactivationDate = $desactivationDate; return $this; } public function getIssue(): ?SocialIssue { return $this->issue; } public function setIssue(?SocialIssue $issue): self { $this->issue = $issue; return $this; } public function getParent(): ?self { return $this->parent; } public function hasParent(): bool { return $this->getParent() instanceof self; } public function setParent(?self $parent): self { $this->parent = $parent; return $this; } /** * @return Collection|self[] */ public function getChildren(): Collection { return $this->children; } public function addChild(self $child): self { if (!$this->children->contains($child)) { $this->children[] = $child; $child->setParent($this); } return $this; } public function removeChild(self $child): self { if ($this->children->removeElement($child)) { // set the owning side to null (unless already changed) if ($child->getParent() === $this) { $child->setParent(null); } } return $this; } /** * @return Collection|self[] All the descendants (children, children of children, ...) */ public function getDescendants(): Collection { $descendants = new ArrayCollection(); foreach ($this->getChildren() as $child) { if(! $descendants->contains($child)) { $descendants->add($child); foreach($child->getDescendants() as $descendantsOfChild) { if(! $descendants->contains($descendantsOfChild)) { $descendants->add($descendantsOfChild); } } } } return $descendants; } /** * @return Collection|self[] All the descendants with the current entity (this) */ public function getDescendantsWithThis(): Collection { $descendants = $this->getDescendants(); if(! $descendants->contains($this)) { $descendants->add($this); } return $descendants; } public function getDefaultNotificationDelay(): ?\DateInterval { return $this->defaultNotificationDelay; } public function setDefaultNotificationDelay(\DateInterval $defaultNotificationDelay): self { $this->defaultNotificationDelay = $defaultNotificationDelay; return $this; } public function getTitle(): array { return $this->title; } public function setTitle(array $title): self { $this->title = $title; return $this; } /** * @return Collection|Goal[] */ public function getGoals(): Collection { return $this->goals; } public function addGoal(Goal $goal): self { if (!$this->goals->contains($goal)) { $this->goals[] = $goal; } return $this; } public function removeGoal(Goal $goal): self { $this->goals->removeElement($goal); return $this; } /** * @return Collection|Result[] */ public function getResults(): Collection { return $this->results; } public function addResult(Result $result): self { if (!$this->results->contains($result)) { $this->results[] = $result; } return $this; } public function removeResult(Result $result): self { $this->results->removeElement($result); return $this; } }