<?phpnamespace 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\InsuranceCategoryRepository")]#[ORM\Table(name: "insurance_category")]class InsuranceCategory{ #[ORM\Column(name: "id", type: "integer")] #[ORM\Id] #[ORM\GeneratedValue(strategy: "AUTO")] private ?int $id; #[ORM\Column(type: "boolean")] private bool $isDeleted = false; #[ORM\Column(name: "name", type: "string", length: 255)] private string $name; #[Vich\UploadableField(mapping: "insuranceCategoryIcon", fileNameProperty: "insuranceCategoryIconFileName", size: "insuranceCategoryIconFileSize")] private File $insuranceCategoryIconFile; #[ORM\Column(type: "string", length: 255, nullable: true)] private ?string $insuranceCategoryIconFileName; #[ORM\Column(type: "integer", nullable: true)] private ?int $insuranceCategoryIconFileSize; #[ORM\Column(type: "datetime", nullable: true)] private ?DateTime $insuranceCategoryIconFileUpdatedAt; public function __toString() { return "#" . $this->id . " - " . $this->name; } /** * 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 setInsuranceCategoryIconFile(File $image = null) { $this->insuranceCategoryIconFile = $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->insuranceCategoryIconFileUpdatedAt = new \DateTime(); } } public function getInsuranceCategoryIconFile() { return $this->insuranceCategoryIconFile; } /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set name * * @param string $name * * @return InsuranceCategory */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set insuranceCategoryIconFileName * * @param string $insuranceCategoryIconFileName * * @return InsuranceCategory */ public function setInsuranceCategoryIconFileName($insuranceCategoryIconFileName) { $this->insuranceCategoryIconFileName = $insuranceCategoryIconFileName; return $this; } /** * Get insuranceCategoryIconFileName * * @return string */ public function getInsuranceCategoryIconFileName() { return $this->insuranceCategoryIconFileName; } /** * Set insuranceCategoryIconFileSize * * @param integer $insuranceCategoryIconFileSize * * @return InsuranceCategory */ public function setInsuranceCategoryIconFileSize($insuranceCategoryIconFileSize) { $this->insuranceCategoryIconFileSize = $insuranceCategoryIconFileSize; return $this; } /** * Get insuranceCategoryIconFileSize * * @return integer */ public function getInsuranceCategoryIconFileSize() { return $this->insuranceCategoryIconFileSize; } /** * Set insuranceCategoryIconFileUpdatedAt * * @param DateTime $insuranceCategoryIconFileUpdatedAt * * @return InsuranceCategory */ public function setInsuranceCategoryIconFileUpdatedAt($insuranceCategoryIconFileUpdatedAt) { $this->insuranceCategoryIconFileUpdatedAt = $insuranceCategoryIconFileUpdatedAt; return $this; } /** * Get insuranceCategoryIconFileUpdatedAt * * @return DateTime */ public function getInsuranceCategoryIconFileUpdatedAt() { return $this->insuranceCategoryIconFileUpdatedAt; } /** * Set isDeleted * * @param boolean $isDeleted * * @return InsuranceCategory */ public function setIsDeleted($isDeleted) { $this->isDeleted = $isDeleted; return $this; } /** * Get isDeleted * * @return boolean */ public function getIsDeleted() { return $this->isDeleted; }}