<?php
namespace App\Entity;
use App\Repository\CBRCArticleContentFileRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=CBRCArticleContentFileRepository::class)
* * @Vich\Uploadable
*/
class CBRCArticleContentFile
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $image1;
/**
* @Vich\UploadableField(mapping="article_images_content", fileNameProperty="image1")
* @var File
*/
private $image1File;
/**
* @ORM\Column(type="datetime", nullable=true)
* @var \DateTime
*/
private $updatedAt;
public function getId(): ?int
{
return $this->id;
}
public function getImage1(): ?string
{
return $this->image1;
}
public function setImage1(string $image1): self
{
$this->image1 = $image1;
return $this;
}
public function setImage1File(File $image = null)
{
$this->image1File = $image;
// VERY IMPORTANT:
// It is required that at least one field changes if you are using Doctrine,
// otherwise the event listeners won't be called and the file is lost
if ($image) {
// if 'updatedAt' is not defined in your entity, use another property
$this->updatedAt = new \DateTime('now');
}
}
public function getImage1File()
{
return $this->image1File;
}
}