src/Entity/PaymentDoc.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PaymentDocRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. #[ORM\Entity(repositoryClassPaymentDocRepository::class)]
  8. #[Vich\Uploadable]
  9. class PaymentDoc
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $docName null;
  17.     //#[ORM\Column(length: 255, nullable: true)]
  18.     #[Vich\UploadableField(mapping'payment_docs' fileNameProperty'docName')]
  19.     private ?File $docFile null;
  20.     #[ORM\ManyToOne(inversedBy'paymentDocs'cascade: ['persist''remove'])]
  21.     private ?Tenants $tenant null;
  22.     #[ORM\ManyToOne(inversedBy'paymentDocs'cascade: ['persist''remove'])]
  23.     private ?PropertyList $property null;
  24.     #[ORM\ManyToOne(inversedBy'paymentDocs'cascade: ['persist''remove'])]
  25.     private ?MonthlyPayments $monthlyPayment null;
  26.     #[ORM\Column(nullabletrue)]
  27.     private ?\DateTimeImmutable $createdAt null;
  28.     /*
  29.     public function __toString()
  30.     {
  31.         return $this->getDocName();       
  32.     }
  33.     */
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getDocName(): ?string
  39.     {
  40.         return $this->docName;
  41.     }
  42.     public function setDocName(?string $docName): self
  43.     {
  44.         $this->docName $docName;
  45.         return $this;
  46.     }
  47.     public function getDocFile(): ?File
  48.     {
  49.         return $this->docFile;
  50.     }
  51.     /**
  52.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $docFile
  53.      */
  54.     public function setDocFile(?File $docFile null): void
  55.     {
  56.         $this->docFile $docFile;
  57.         /*
  58.         if (null !== $docFile) {
  59.             $this->createdAt = new \DateTimeImmutable();
  60.         }
  61.         */
  62.         //return $this;
  63.     }
  64.     public function getTenant(): ?Tenants
  65.     {
  66.         return $this->tenant;
  67.     }
  68.     public function setTenant(?Tenants $tenant): self
  69.     {
  70.         $this->tenant $tenant;
  71.         return $this;
  72.     }
  73.     public function getProperty(): ?PropertyList
  74.     {
  75.         return $this->property;
  76.     }
  77.     public function setProperty(?PropertyList $property): self
  78.     {
  79.         $this->property $property;
  80.         return $this;
  81.     }
  82.     public function getMonthlyPayment(): ?MonthlyPayments
  83.     {
  84.         return $this->monthlyPayment;
  85.     }
  86.     public function setMonthlyPayment(?MonthlyPayments $monthlyPayment): self
  87.     {
  88.         $this->monthlyPayment $monthlyPayment;
  89.         return $this;
  90.     }
  91.     public function getCreatedAt(): ?\DateTimeImmutable
  92.     {
  93.         return $this->createdAt;
  94.     }
  95.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  96.     {
  97.         $this->createdAt $createdAt;
  98.         return $this;
  99.     }
  100. }