src/Entity/FillingComplaint.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. #[Vich\Uploadable]
  8. #[ORM\Entity(repositoryClass"App\Repository\FillingComplaintRepository")]
  9. #[ORM\Table(name"filling_complaint")]
  10. class FillingComplaint
  11. {
  12.     #[ORM\Column(type"boolean")]
  13.     private bool $isDeleted false;
  14.     #[ORM\Column(name"createdAt"type"datetime")]
  15.     private DateTime $createdAt;
  16.     #[ORM\ManyToOne(targetEntitySteal::class, inversedBy"fillingComplaints"cascade: ["persist"])]
  17.     #[ORM\JoinColumn(nullabletrue)]
  18.     private ?Steal $steal;
  19.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy"fillingComplaints"cascade: ["persist"])]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private User $user;
  22.     #[ORM\Column(name"id"type"integer")]
  23.     #[ORM\Id]
  24.     #[ORM\GeneratedValue(strategy"AUTO")]
  25.     private ?int $id;
  26.     /**
  27.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  28.      */
  29.     #[Vich\UploadableField(mapping"fillingComplaint"fileNameProperty"fillingComplaintFileName"size"fillingComplaintFileSize")]
  30.     private File $fillingComplaintFile;
  31.     #[ORM\Column(type"string"length255nullabletrue)]
  32.     private ?string $fillingComplaintFileName;
  33.     #[ORM\Column(type"integer"nullabletrue)]
  34.     private ?int $fillingComplaintFileSize;
  35.     #[ORM\Column(type"datetime"nullabletrue)]
  36.     private ?DateTime $fillingComplaintFileUpdatedAt;
  37.     public function __construct() {
  38.         $this->createdAt = new DateTime();
  39.     }
  40.     public function __toString() {
  41.         return "#" $this->id " - " $this->fillingComplaintFileName;
  42.     }
  43.     /**
  44.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  45.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  46.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  47.      * must be able to accept an instance of 'File' as the bundle will inject one here
  48.      * during Doctrine hydration.
  49.      *
  50.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
  51.      */
  52.     public function setFillingComplaintFile(File $image null) {
  53.         $this->fillingComplaintFile $image;
  54.         if (null !== $image) {
  55. // It is required that at least one field changes if you are using doctrine
  56. // otherwise the event listeners won't be called and the file is lost
  57.             $this->fillingComplaintFileUpdatedAt = new \DateTime();
  58.         }
  59.     }
  60.     public function getFillingComplaintFile() {
  61.         return $this->fillingComplaintFile;
  62.     }
  63.     /**
  64.      * Get id
  65.      *
  66.      * @return int
  67.      */
  68.     public function getId() {
  69.         return $this->id;
  70.     }
  71.     /**
  72.      * Set createdAt
  73.      *
  74.      * @param DateTime $createdAt
  75.      *
  76.      * @return FillingComplaint
  77.      */
  78.     public function setCreatedAt($createdAt) {
  79.         $this->createdAt $createdAt;
  80.         return $this;
  81.     }
  82.     /**
  83.      * Get createdAt
  84.      *
  85.      * @return DateTime
  86.      */
  87.     public function getCreatedAt() {
  88.         return $this->createdAt;
  89.     }
  90.     /**
  91.      * Set fillingComplaintFileName
  92.      *
  93.      * @param string $fillingComplaintFileName
  94.      *
  95.      * @return FillingComplaint
  96.      */
  97.     public function setFillingComplaintFileName($fillingComplaintFileName) {
  98.         $this->fillingComplaintFileName $fillingComplaintFileName;
  99.         return $this;
  100.     }
  101.     /**
  102.      * Get fillingComplaintFileName
  103.      *
  104.      * @return string
  105.      */
  106.     public function getFillingComplaintFileName() {
  107.         return $this->fillingComplaintFileName;
  108.     }
  109.     /**
  110.      * Set fillingComplaintFileSize
  111.      *
  112.      * @param integer $fillingComplaintFileSize
  113.      *
  114.      * @return FillingComplaint
  115.      */
  116.     public function setFillingComplaintFileSize($fillingComplaintFileSize) {
  117.         $this->fillingComplaintFileSize $fillingComplaintFileSize;
  118.         return $this;
  119.     }
  120.     /**
  121.      * Get fillingComplaintFileSize
  122.      *
  123.      * @return integer
  124.      */
  125.     public function getFillingComplaintFileSize() {
  126.         return $this->fillingComplaintFileSize;
  127.     }
  128.     /**
  129.      * Set fillingComplaintFileUpdatedAt
  130.      *
  131.      * @param DateTime $fillingComplaintFileUpdatedAt
  132.      *
  133.      * @return FillingComplaint
  134.      */
  135.     public function setFillingComplaintFileUpdatedAt($fillingComplaintFileUpdatedAt) {
  136.         $this->fillingComplaintFileUpdatedAt $fillingComplaintFileUpdatedAt;
  137.         return $this;
  138.     }
  139.     /**
  140.      * Get fillingComplaintFileUpdatedAt
  141.      *
  142.      * @return DateTime
  143.      */
  144.     public function getFillingComplaintFileUpdatedAt() {
  145.         return $this->fillingComplaintFileUpdatedAt;
  146.     }
  147.     /**
  148.      * Set user
  149.      *
  150.      * @param \App\Entity\User $user
  151.      *
  152.      * @return FillingComplaint
  153.      */
  154.     public function setUser(\App\Entity\User $user) {
  155.         $this->user $user;
  156.         return $this;
  157.     }
  158.     /**
  159.      * Get user
  160.      *
  161.      * @return \App\Entity\User
  162.      */
  163.     public function getUser() {
  164.         return $this->user;
  165.     }
  166.     /**
  167.      * Set steal
  168.      *
  169.      * @param \App\Entity\Steal $steal
  170.      *
  171.      * @return FillingComplaint
  172.      */
  173.     public function setSteal(\App\Entity\Steal $steal null) {
  174.         $this->steal $steal;
  175.         return $this;
  176.     }
  177.     /**
  178.      * Get steal
  179.      *
  180.      * @return \App\Entity\Steal
  181.      */
  182.     public function getSteal() {
  183.         return $this->steal;
  184.     }
  185.     /**
  186.      * Set isDeleted
  187.      *
  188.      * @param boolean $isDeleted
  189.      *
  190.      * @return FillingComplaint
  191.      */
  192.     public function setIsDeleted($isDeleted)
  193.     {
  194.         $this->isDeleted $isDeleted;
  195.         return $this;
  196.     }
  197.     /**
  198.      * Get isDeleted
  199.      *
  200.      * @return boolean
  201.      */
  202.     public function getIsDeleted()
  203.     {
  204.         return $this->isDeleted;
  205.     }
  206. }