<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\AlbumsRepository") */class Albums{ private $dir = 'upload/images/albums'; private $thumbnailDir = 'upload/thumbnails/albums'; private $validsMimetypes = []; /** * Constructor */ public function __construct() { $this->pictures = new \Doctrine\Common\Collections\ArrayCollection(); } public function getDir(): ?string { return $this->dir; } public function setDir(?string $dir): self { $this->dir = $dir; return $this; } public function setValidsMimetypes(?array $mimetypes): self { $this->validsMimetypes = $mimetypes; return $this; } public function getValidsMimetypes(): ?array { return $this->validsMimetypes; } /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="title", type="string", length=255, nullable=true) */ private $title; /** * @ORM\Column(name="isEnabled",type="boolean", nullable=true) */ private $isEnabled; /** * @ORM\ManyToMany(targetEntity=Picture::class, cascade={"persist","remove"}) */ private $pictures; public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): self { $this->title = $title; return $this; } public function getIsEnabled(): ?bool { return $this->isEnabled; } public function setIsEnabled(?bool $isEnabled): self { $this->isEnabled = $isEnabled; return $this; } /** * @return Collection|Picture[] */ public function getPictures(): Collection { return $this->pictures; } public function addPicture(Picture $picture): self { if ($picture && !$this->pictures->contains($picture)) { $picture->setDir($this->dir); $picture->setThumbnailDir($this->thumbnailDir); $this->pictures[] = $picture; } return $this; } public function removePicture(Picture $picture): self { $this->pictures->removeElement($picture); return $this; }}