<?phpnamespace App\Entity;use App\Repository\AppellationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=AppellationRepository::class) */class Appellation{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $nom; /** * @ORM\OneToMany(targetEntity=Cuvee::class, mappedBy="appellation") */ private $cuvees; /** * @ORM\Column(type="string", length=255) */ private $type; public function __construct() { $this->cuvees = new ArrayCollection(); } public function __toString() { return $this->nom; } public function getId(): ?int { return $this->id; } public function getNom(): ?string { return $this->nom; } public function setNom(string $nom): self { $this->nom = $nom; return $this; } /** * @return Collection<int, Cuvee> */ public function getCuvees(): Collection { return $this->cuvees; } public function addCuvee(Cuvee $cuvee): self { if (!$this->cuvees->contains($cuvee)) { $this->cuvees[] = $cuvee; $cuvee->setAppellation($this); } return $this; } public function removeCuvee(Cuvee $cuvee): self { if ($this->cuvees->removeElement($cuvee)) { // set the owning side to null (unless already changed) if ($cuvee->getAppellation() === $this) { $cuvee->setAppellation(null); } } return $this; } public function getType(): ?string { return $this->type; } public function setType(string $type): self { $this->type = $type; return $this; }}