<?phpnamespace App\Entity;use App\Repository\DepartementRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=DepartementRepository::class) */class Departement{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=Country::class, inversedBy="departements") * @ORM\JoinColumn(nullable=true) */ private $country; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\OneToMany(targetEntity=Location::class, mappedBy="departement") */ private $locations; /** * @ORM\ManyToOne(targetEntity=Media::class) */ private $media; /** * @ORM\Column(type="string", length=4) */ private $number; public function __construct() { $this->locations = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getCountry(): ?Country { return $this->country; } public function setCountry(?Country $country): self { $this->country = $country; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } /** * @return Collection|Location[] */ public function getLocations(): Collection { return $this->locations; } public function addLocation(Location $location): self { if (!$this->locations->contains($location)) { $this->locations[] = $location; $location->setDepartement($this); } return $this; } public function removeLocation(Location $location): self { if ($this->locations->removeElement($location)) { // set the owning side to null (unless already changed) if ($location->getDepartement() === $this) { $location->setDepartement(null); } } return $this; } public function getMedia(): ?Media { return $this->media; } public function setMedia(?Media $media): self { $this->media = $media; return $this; } public function getNumber(): ?string { return $this->number; } public function setNumber(string $number): self { $this->number = $number; return $this; }}