<?phpnamespace App\Entity;use App\Entity\Item\Item;use Doctrine\ORM\Mapping as ORM;use App\Repository\JobLevelRepository;use Doctrine\Common\Collections\Collection;use Doctrine\Common\Collections\ArrayCollection;/** * @ORM\Entity(repositoryClass=JobLevelRepository::class) */class JobLevel{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="integer", nullable=true) */ private $position; /** * @ORM\Column(type="boolean", nullable=true) */ private $active; /** * @ORM\ManyToMany(targetEntity=Item::class, cascade={"persist","refresh"}) */ private $item; public function __construct() { $this->item = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getPosition(): ?int { return $this->position; } public function setPosition(?int $position): self { $this->position = $position; return $this; } public function getActive(): ?bool { return $this->active; } public function setActive(?bool $active): self { $this->active = $active; return $this; } /** * @return Collection|Item[] */ public function getItems(): Collection { return $this->item; } public function addItem(Item $item): self { if (!$this->item->contains($item)) { $this->item[] = $item; $item->addJobLevel($this); } return $this; } public function removeItem(Item $item): self { if ($this->item->removeElement($item)) { // set the owning side to null (unless already changed) if ($item->getJobLevels() === $this) { $item->removeJobLevel(null); } } return $this; }}