<?php
namespace App\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[Vich\Uploadable]
#[ORM\Entity(repositoryClass: "App\Repository\FillingComplaintRepository")]
#[ORM\Table(name: "filling_complaint")]
class FillingComplaint
{
#[ORM\Column(type: "boolean")]
private bool $isDeleted = false;
#[ORM\Column(name: "createdAt", type: "datetime")]
private DateTime $createdAt;
#[ORM\ManyToOne(targetEntity: Steal::class, inversedBy: "fillingComplaints", cascade: ["persist"])]
#[ORM\JoinColumn(nullable: true)]
private ?Steal $steal;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: "fillingComplaints", cascade: ["persist"])]
#[ORM\JoinColumn(nullable: false)]
private User $user;
#[ORM\Column(name: "id", type: "integer")]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: "AUTO")]
private ?int $id;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*/
#[Vich\UploadableField(mapping: "fillingComplaint", fileNameProperty: "fillingComplaintFileName", size: "fillingComplaintFileSize")]
private File $fillingComplaintFile;
#[ORM\Column(type: "string", length: 255, nullable: true)]
private ?string $fillingComplaintFileName;
#[ORM\Column(type: "integer", nullable: true)]
private ?int $fillingComplaintFileSize;
#[ORM\Column(type: "datetime", nullable: true)]
private ?DateTime $fillingComplaintFileUpdatedAt;
public function __construct() {
$this->createdAt = new DateTime();
}
public function __toString() {
return "#" . $this->id . " - " . $this->fillingComplaintFileName;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
*/
public function setFillingComplaintFile(File $image = null) {
$this->fillingComplaintFile = $image;
if (null !== $image) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->fillingComplaintFileUpdatedAt = new \DateTime();
}
}
public function getFillingComplaintFile() {
return $this->fillingComplaintFile;
}
/**
* Get id
*
* @return int
*/
public function getId() {
return $this->id;
}
/**
* Set createdAt
*
* @param DateTime $createdAt
*
* @return FillingComplaint
*/
public function setCreatedAt($createdAt) {
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return DateTime
*/
public function getCreatedAt() {
return $this->createdAt;
}
/**
* Set fillingComplaintFileName
*
* @param string $fillingComplaintFileName
*
* @return FillingComplaint
*/
public function setFillingComplaintFileName($fillingComplaintFileName) {
$this->fillingComplaintFileName = $fillingComplaintFileName;
return $this;
}
/**
* Get fillingComplaintFileName
*
* @return string
*/
public function getFillingComplaintFileName() {
return $this->fillingComplaintFileName;
}
/**
* Set fillingComplaintFileSize
*
* @param integer $fillingComplaintFileSize
*
* @return FillingComplaint
*/
public function setFillingComplaintFileSize($fillingComplaintFileSize) {
$this->fillingComplaintFileSize = $fillingComplaintFileSize;
return $this;
}
/**
* Get fillingComplaintFileSize
*
* @return integer
*/
public function getFillingComplaintFileSize() {
return $this->fillingComplaintFileSize;
}
/**
* Set fillingComplaintFileUpdatedAt
*
* @param DateTime $fillingComplaintFileUpdatedAt
*
* @return FillingComplaint
*/
public function setFillingComplaintFileUpdatedAt($fillingComplaintFileUpdatedAt) {
$this->fillingComplaintFileUpdatedAt = $fillingComplaintFileUpdatedAt;
return $this;
}
/**
* Get fillingComplaintFileUpdatedAt
*
* @return DateTime
*/
public function getFillingComplaintFileUpdatedAt() {
return $this->fillingComplaintFileUpdatedAt;
}
/**
* Set user
*
* @param \App\Entity\User $user
*
* @return FillingComplaint
*/
public function setUser(\App\Entity\User $user) {
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \App\Entity\User
*/
public function getUser() {
return $this->user;
}
/**
* Set steal
*
* @param \App\Entity\Steal $steal
*
* @return FillingComplaint
*/
public function setSteal(\App\Entity\Steal $steal = null) {
$this->steal = $steal;
return $this;
}
/**
* Get steal
*
* @return \App\Entity\Steal
*/
public function getSteal() {
return $this->steal;
}
/**
* Set isDeleted
*
* @param boolean $isDeleted
*
* @return FillingComplaint
*/
public function setIsDeleted($isDeleted)
{
$this->isDeleted = $isDeleted;
return $this;
}
/**
* Get isDeleted
*
* @return boolean
*/
public function getIsDeleted()
{
return $this->isDeleted;
}
}