<?php
namespace App\Entity\Shipping;
use App\Entity\AppUser;
use App\Entity\Shipping;
use App\Repository\Shipping\PaymentEvidenceRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=PaymentEvidenceRepository::class)
* @Vich\Uploadable()
*/
class PaymentEvidence
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $originalName;
/**
* @Vich\UploadableField(fileNameProperty="name", mapping="shipping_payment")
* @var File
*/
private $file;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=Shipping::class, inversedBy="paymentEvidence")
* @ORM\JoinColumn(nullable=false)
*/
private $shipping;
/**
* @ORM\ManyToOne(targetEntity=AppUser::class)
* @ORM\JoinColumn(nullable=false)
*/
private $createdBy;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getOriginalName(): ?string
{
return $this->originalName;
}
public function setOriginalName(?string $originalName): self
{
$this->originalName = $originalName;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getShipping(): ?Shipping
{
return $this->shipping;
}
public function setShipping(?Shipping $shipping): self
{
$this->shipping = $shipping;
return $this;
}
public function getFile(): File
{
return $this->file;
}
public function setFile(?File $file): void
{
$this->file = $file;
if ($file) {
$this->updatedAt = new \DateTimeImmutable();
}
}
public function getCreatedBy(): ?AppUser
{
return $this->createdBy;
}
public function setCreatedBy(?AppUser $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
}