<?phpnamespace App\Entity;use App\Repository\LanguageRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=LanguageRepository::class) */class Language{ const LANGUAGE_HU = 1; const LANGUAGE_RO = 2; const LANGUAGE_EN = 3; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $iso; /** * @ORM\OneToMany(targetEntity=Offer::class, mappedBy="language") */ private $offers; public function __construct() { $this->offers = new ArrayCollection(); } 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; } public function getIso(): ?string { return $this->iso; } public function setIso(string $iso): self { $this->iso = $iso; return $this; } /** * @return Collection<int, Offer> */ public function getOffers(): Collection { return $this->offers; } public function addOffer(Offer $offer): self { if (!$this->offers->contains($offer)) { $this->offers[] = $offer; $offer->setLanguage($this); } return $this; } public function removeOffer(Offer $offer): self { if ($this->offers->removeElement($offer)) { // set the owning side to null (unless already changed) if ($offer->getLanguage() === $this) { $offer->setLanguage(null); } } return $this; }}