<?php
namespace App\Entity\Gallery;
use App\Entity\AbstractBase;
use App\Entity\Interfaces\ImageNotNullInterface;
use App\Entity\Traits\HasImageNotNullTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Table(name="vulco_gallery_image")
* @ORM\Entity(repositoryClass=GalleryImageRepository::class)
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
* @Vich\Uploadable
*/
class GalleryImage extends AbstractBase implements ImageNotNullInterface
{
use HasImageNotNullTrait;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $name = null;
/**
* @Vich\UploadableField(mapping="gallery_image_image", fileNameProperty="imageName")
*/
private ?File $image = null;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gallery\GalleryAlbum", inversedBy="images")
*
* @ORM\JoinColumn(name="album_id", referencedColumnName="id")
*/
private GalleryAlbum $album;
public function __construct()
{
$this->setHasImage(false);
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getAlbum(): GalleryAlbum
{
return $this->album;
}
public function setAlbum(GalleryAlbum $album): self
{
$this->album = $album;
return $this;
}
}