<?php
namespace App\Entity;
use App\Repository\CBRCAGCADocumentRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=CBRCAGCADocumentRepository::class)
* @Vich\Uploadable
*/
class CBRCAGCADocument
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $document1;
/**
* @ORM\Column(type="datetime", nullable=true)
* @var \DateTime
*/
private $updatedAt;
/**
* @Vich\UploadableField(mapping="ag_document", fileNameProperty="document1")
* @var File
*/
private $document1File;
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;
}
public function getDocument1(): ?string
{
return $this->document1;
}
public function setDocument1(?string $document1): self
{
$this->document1 = $document1;
return $this;
}
public function setDocument1File(File $file = null)
{
$this->document1File = $file;
// 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 ($file) {
// if 'updatedAt' is not defined in your entity, use another property
$this->updatedAt = new \DateTime('now');
}
}
public function getDocument1File()
{
return $this->document1File;
}
public function getUpdateAt(): \DateTime
{
return $this->updatedAt;
}
}