<?phpnamespace App\Entity\Gos;use App\Entity\Gos\Uniqskills\Cooperator;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\CooperatorGroupRepository") */class CooperatorGroup{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Cooperator", inversedBy="cooperatorGroups") */ private $cooperator; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\Term", mappedBy="cooperatorGroup") */ private $terms; public function __construct() { $this->cooperator = new ArrayCollection(); $this->terms = new ArrayCollection(); } public function __toString() { return $this->name; } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } /** * @return Collection|Cooperator[] */ public function getCooperator(): Collection { return $this->cooperator; } public function addCooperator(Cooperator $cooperator): self { if (!$this->cooperator->contains($cooperator)) { $this->cooperator[] = $cooperator; } return $this; } public function removeCooperator(Cooperator $cooperator): self { if ($this->cooperator->contains($cooperator)) { $this->cooperator->removeElement($cooperator); } return $this; } /** * @return Collection|Term[] */ public function getTerms(): Collection { return $this->terms; } public function addTerm(Term $term): self { if (!$this->terms->contains($term)) { $this->terms[] = $term; $term->setCooperatorGroup($this); } return $this; } public function removeTerm(Term $term): self { if ($this->terms->contains($term)) { $this->terms->removeElement($term); // set the owning side to null (unless already changed) if ($term->getCooperatorGroup() === $this) { $term->setCooperatorGroup(null); } } return $this; }}