src/Entity/Gos/Uniqskills/UserAnswerFile.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Uniqskills;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. /**
  6.  * UserAnswerFile
  7.  *
  8.  * @ORM\Table(name="user_answer_file")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\UserAnswerFileRepository")
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class UserAnswerFile
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $name;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      *
  29.      * @Assert\File(
  30.      *  maxSize="50M",
  31.      *  mimeTypes={
  32.      *     "image/png",
  33.      *     "image/jpeg", "image/pjpeg",
  34.      *     "application/pdf", "application/x-pdf",
  35.      *     "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  36.      *     "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  37.      *     "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation",
  38.      *     "application/vnd.oasis.opendocument.text",
  39.      *     "text/rtf",
  40.      *     "text/html",
  41.      *     "text/plain"
  42.      *  }
  43.      * )
  44.      *
  45.      * @var string
  46.      */
  47.     private $file;
  48.     /**
  49.      * @ORM\Column(type="datetime", nullable=true)
  50.      */
  51.     private $downloadAt;
  52.     /**
  53.      * @ORM\Column(type="datetime")
  54.      */
  55.     private $createdAt;
  56.     /**
  57.      * @ORM\Column(type="datetime", nullable=true)
  58.      */
  59.     private $updatedAt;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity="UserAnswer", inversedBy="userAnswerFile")
  62.      * @ORM\JoinColumn(onDelete="cascade")
  63.      */
  64.     private $userAnswer;
  65.     /** @ORM\PrePersist() */
  66.     public function prePersist()
  67.     {
  68.         $this->createdAt = new \DateTime();
  69.     }
  70.     /** @ORM\PreUpdate() */
  71.     public function preUpdate()
  72.     {
  73.         $this->updatedAt = new \DateTime();
  74.     }
  75.     public function __toString()
  76.     {
  77.         return (string)$this->id;
  78.     }
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getName(): ?string
  84.     {
  85.         return $this->name;
  86.     }
  87.     public function setName(string $name): self
  88.     {
  89.         $this->name $name;
  90.         return $this;
  91.     }
  92.     public function getFile(): ?string
  93.     {
  94.         return $this->file;
  95.     }
  96.     public function setFile(?string $file): self
  97.     {
  98.         $this->file $file;
  99.         return $this;
  100.     }
  101.     public function getDownloadAt(): ?\DateTimeInterface
  102.     {
  103.         return $this->downloadAt;
  104.     }
  105.     public function setDownloadAt(?\DateTimeInterface $downloadAt): self
  106.     {
  107.         $this->downloadAt $downloadAt;
  108.         return $this;
  109.     }
  110.     public function getCreatedAt(): ?\DateTimeInterface
  111.     {
  112.         return $this->createdAt;
  113.     }
  114.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  115.     {
  116.         $this->createdAt $createdAt;
  117.         return $this;
  118.     }
  119.     public function getUpdatedAt(): ?\DateTimeInterface
  120.     {
  121.         return $this->updatedAt;
  122.     }
  123.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  124.     {
  125.         $this->updatedAt $updatedAt;
  126.         return $this;
  127.     }
  128.     public function getUserAnswer(): ?UserAnswer
  129.     {
  130.         return $this->userAnswer;
  131.     }
  132.     public function setUserAnswer(?UserAnswer $userAnswer): self
  133.     {
  134.         $this->userAnswer $userAnswer;
  135.         return $this;
  136.     }
  137.     
  138.     /* ****************************** GETTERS & SETTERS ******************************  */
  139. }