<?php
namespace App\Entity;
use App\Repository\PaymentDocRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[ORM\Entity(repositoryClass: PaymentDocRepository::class)]
#[Vich\Uploadable]
class PaymentDoc
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $docName = null;
//#[ORM\Column(length: 255, nullable: true)]
#[Vich\UploadableField(mapping: 'payment_docs' , fileNameProperty: 'docName')]
private ?File $docFile = null;
#[ORM\ManyToOne(inversedBy: 'paymentDocs', cascade: ['persist', 'remove'])]
private ?Tenants $tenant = null;
#[ORM\ManyToOne(inversedBy: 'paymentDocs', cascade: ['persist', 'remove'])]
private ?PropertyList $property = null;
#[ORM\ManyToOne(inversedBy: 'paymentDocs', cascade: ['persist', 'remove'])]
private ?MonthlyPayments $monthlyPayment = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $createdAt = null;
/*
public function __toString()
{
return $this->getDocName();
}
*/
public function getId(): ?int
{
return $this->id;
}
public function getDocName(): ?string
{
return $this->docName;
}
public function setDocName(?string $docName): self
{
$this->docName = $docName;
return $this;
}
public function getDocFile(): ?File
{
return $this->docFile;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $docFile
*/
public function setDocFile(?File $docFile = null): void
{
$this->docFile = $docFile;
/*
if (null !== $docFile) {
$this->createdAt = new \DateTimeImmutable();
}
*/
//return $this;
}
public function getTenant(): ?Tenants
{
return $this->tenant;
}
public function setTenant(?Tenants $tenant): self
{
$this->tenant = $tenant;
return $this;
}
public function getProperty(): ?PropertyList
{
return $this->property;
}
public function setProperty(?PropertyList $property): self
{
$this->property = $property;
return $this;
}
public function getMonthlyPayment(): ?MonthlyPayments
{
return $this->monthlyPayment;
}
public function setMonthlyPayment(?MonthlyPayments $monthlyPayment): self
{
$this->monthlyPayment = $monthlyPayment;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}