<?phpnamespace App\Entity;use App\Repository\LabelRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=LabelRepository::class) */class Label{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\OneToMany(targetEntity=Vinyl::class, mappedBy="label") */ private $vinyls; /** * @ORM\OneToMany(targetEntity=Cd::class, mappedBy="label") */ private $cds; /** * @ORM\Column(type="string", length=255) */ private $slug; public function __construct() { $this->vinyls = new ArrayCollection(); $this->cds = 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; } /** * @return Collection|Vinyl[] */ public function getVinyls(): Collection { return $this->vinyls; } public function addVinyl(Vinyl $vinyl): self { if (!$this->vinyls->contains($vinyl)) { $this->vinyls[] = $vinyl; $vinyl->setLabel($this); } return $this; } public function removeVinyl(Vinyl $vinyl): self { if ($this->vinyls->removeElement($vinyl)) { // set the owning side to null (unless already changed) if ($vinyl->getLabel() === $this) { $vinyl->setLabel(null); } } return $this; } /** * @return Collection|Cd[] */ public function getCds(): Collection { return $this->cds; } public function addCd(Cd $cd): self { if (!$this->cds->contains($cd)) { $this->cds[] = $cd; $cd->setLabel($this); } return $this; } public function removeCd(Cd $cd): self { if ($this->cds->removeElement($cd)) { // set the owning side to null (unless already changed) if ($cd->getLabel() === $this) { $cd->setLabel(null); } } return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; return $this; } public function __toString() { return $this->name; }}