<?phpnamespace App\Entity;use App\Repository\AgentRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\PositionRepository") */class Position{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $nomPosition; /** * @ORM\Column(type="integer") */ private $level; /** * @ORM\Column(type="string", length=500) */ private $message; /** * @ORM\ManyToOne(targetEntity=Ville::class, inversedBy="positions") */ private $ville; /** * @ORM\OneToMany(targetEntity=SousPosition::class, mappedBy="trackPosition", orphanRemoval=true, cascade={"persist"}) * @ORM\OrderBy({"niveau" = "ASC"}) */ private $sousPositions; /** * @ORM\Column(type="boolean") */ private $visible; public function __construct() { $this->sousPositions = new ArrayCollection(); $this->visible = true; } public function getId(): ?int { return $this->id; } public function getNomPosition(): ?string { return $this->nomPosition; } /** * @return Collection|SousPosition[] */ public function getSousPositions(): Collection { return $this->sousPositions; } public function addSousPosition(SousPosition $sousPosition): self { if (!$this->sousPositions->contains($sousPosition)) { $this->sousPositions[] = $sousPosition; $sousPosition->setTrackPosition($this); } return $this; } public function setNomPosition(string $nomPosition): self { $this->nomPosition = $nomPosition; return $this; } public function getLevel(): ?int { return $this->level; } public function setLevel(int $level): self { $this->level = $level; return $this; } public function getMessage(): ?string { return $this->message; } public function setMessage(string $message): self { $this->message = $message; return $this; } public function getVille(): ?Ville { return $this->ville; } public function setVille(?Ville $ville): self { $this->ville = $ville; return $this; } public function setVisible(bool $visible): self { $this->visible = $visible; return $this; } public function getVisible(): ?bool { return $this->visible; } public function __toString() { return $this->nomPosition; }}