src/Entity/CBRCAGCADocument.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CBRCAGCADocumentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CBRCAGCADocumentRepository::class)
  9.  * @Vich\Uploadable
  10.  */
  11. class CBRCAGCADocument
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $document1;
  27.     /**
  28.      * @ORM\Column(type="datetime", nullable=true)
  29.      * @var \DateTime
  30.      */
  31.     private $updatedAt;
  32.     /**
  33.      * @Vich\UploadableField(mapping="ag_document", fileNameProperty="document1")
  34.      * @var File
  35.      */
  36.     private $document1File;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(string $name): self
  46.     {
  47.         $this->name $name;
  48.         return $this;
  49.     }
  50.     public function getDocument1(): ?string
  51.     {
  52.         return $this->document1;
  53.     }
  54.     public function setDocument1(?string $document1): self
  55.     {
  56.         $this->document1 $document1;
  57.         return $this;
  58.     }
  59.     public function setDocument1File(File $file null)
  60.     {
  61.         $this->document1File $file;
  62.         // VERY IMPORTANT:
  63.         // It is required that at least one field changes if you are using Doctrine,
  64.         // otherwise the event listeners won't be called and the file is lost
  65.         if ($file) {
  66.             // if 'updatedAt' is not defined in your entity, use another property
  67.             $this->updatedAt = new \DateTime('now');
  68.         }
  69.     }
  70.     public function getDocument1File()
  71.     {
  72.         return $this->document1File;
  73.     }
  74.     public function getUpdateAt(): \DateTime
  75.     {
  76.         return $this->updatedAt;
  77.     }
  78. }