src/Entity/Shipping/PaymentEvidence.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Shipping;
  3. use App\Entity\AppUser;
  4. use App\Entity\Shipping;
  5. use App\Repository\Shipping\PaymentEvidenceRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10.  * @ORM\Entity(repositoryClass=PaymentEvidenceRepository::class)
  11.  * @Vich\Uploadable()
  12.  */
  13. class PaymentEvidence
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\Column(type="text", nullable=true)
  27.      */
  28.     private $originalName;
  29.     /**
  30.      * @Vich\UploadableField(fileNameProperty="name", mapping="shipping_payment")
  31.      * @var File
  32.      */
  33.     private $file;
  34.     /**
  35.      * @ORM\Column(type="datetime_immutable")
  36.      */
  37.     private $updatedAt;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=Shipping::class, inversedBy="paymentEvidence")
  40.      * @ORM\JoinColumn(nullable=false)
  41.      */
  42.     private $shipping;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=AppUser::class)
  45.      * @ORM\JoinColumn(nullable=false)
  46.      */
  47.     private $createdBy;
  48.     public function getId(): ?int
  49.     {
  50.         return $this->id;
  51.     }
  52.     public function getName(): ?string
  53.     {
  54.         return $this->name;
  55.     }
  56.     public function setName(?string $name): self
  57.     {
  58.         $this->name $name;
  59.         return $this;
  60.     }
  61.     public function getOriginalName(): ?string
  62.     {
  63.         return $this->originalName;
  64.     }
  65.     public function setOriginalName(?string $originalName): self
  66.     {
  67.         $this->originalName $originalName;
  68.         return $this;
  69.     }
  70.     public function getUpdatedAt(): ?\DateTimeImmutable
  71.     {
  72.         return $this->updatedAt;
  73.     }
  74.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  75.     {
  76.         $this->updatedAt $updatedAt;
  77.         return $this;
  78.     }
  79.     public function getShipping(): ?Shipping
  80.     {
  81.         return $this->shipping;
  82.     }
  83.     public function setShipping(?Shipping $shipping): self
  84.     {
  85.         $this->shipping $shipping;
  86.         return $this;
  87.     }
  88.     public function getFile(): File
  89.     {
  90.         return $this->file;
  91.     }
  92.     public function setFile(?File $file): void
  93.     {
  94.         $this->file $file;
  95.         if ($file) {
  96.             $this->updatedAt = new \DateTimeImmutable();
  97.         }
  98.     }
  99.     public function getCreatedBy(): ?AppUser
  100.     {
  101.         return $this->createdBy;
  102.     }
  103.     public function setCreatedBy(?AppUser $createdBy): self
  104.     {
  105.         $this->createdBy $createdBy;
  106.         return $this;
  107.     }
  108. }