<?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;
#[ORM\Entity(repositoryClass: "App\Repository\TechnicalDataSheetRepository")]
#[ORM\Table(name: "technical_data_sheet")]
class TechnicalDataSheet {
#[ORM\Column(type: "boolean")]
private bool $isDeleted = false;
#[ORM\Column(name: "createdAt", type: "datetime")]
private DateTime $createdAt;
#[ORM\Column(name: "id", type: "integer")]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: "AUTO")]
private ?int $id;
#[ORM\Column(name: "title", type: "string", length: 255, nullable: true)]
private ?string $title = null;
#[ORM\Column(name: "description", type: "text", nullable: true)]
private ?string $description = null;
#[Vich\UploadableField(mapping: "technicalDataSheet", fileNameProperty: "technicalDataSheetFileName", size: "technicalDataSheetFileSize")]
private ?File $technicalDataSheetFile = null;
#[ORM\Column(type: "string", length: 255, nullable: true)]
private ?string $technicalDataSheetFileName = null;
#[ORM\Column(type: "integer", nullable: true)]
private ?int $technicalDataSheetFileSize = null;
#[ORM\Column(type: "datetime", nullable: true)]
private ?DateTime $technicalDataSheetFileUpdatedAt = null;
public function __construct() {
$this->createdAt = new DateTime();
}
public function __toString() {
return "#" . $this->id . " - " . $this->technicalDataSheetFileName;
}
/**
* 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 setTechnicalDataSheetFile(File $image = null) {
$this->technicalDataSheetFile = $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->technicalDataSheetFileUpdatedAt = new \DateTime();
}
}
public function getTechnicalDataSheetFile() {
return $this->technicalDataSheetFile;
}
/**
* Get id
*
* @return int
*/
public function getId() {
return $this->id;
}
/**
* Set title
*
* @param string $title
*
* @return TechnicalDataSheet
*/
public function setTitle($title) {
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle() {
return $this->title;
}
/**
* Set description
*
* @param string $description
*
* @return TechnicalDataSheet
*/
public function setDescription($description) {
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription() {
return $this->description;
}
/**
* Set technicalDataSheetFileName
*
* @param string $technicalDataSheetFileName
*
* @return TechnicalDataSheet
*/
public function setTechnicalDataSheetFileName($technicalDataSheetFileName) {
$this->technicalDataSheetFileName = $technicalDataSheetFileName;
return $this;
}
/**
* Get technicalDataSheetFileName
*
* @return string
*/
public function getTechnicalDataSheetFileName() {
return $this->technicalDataSheetFileName;
}
/**
* Set technicalDataSheetFileSize
*
* @param integer $technicalDataSheetFileSize
*
* @return TechnicalDataSheet
*/
public function setTechnicalDataSheetFileSize($technicalDataSheetFileSize) {
$this->technicalDataSheetFileSize = $technicalDataSheetFileSize;
return $this;
}
/**
* Get technicalDataSheetFileSize
*
* @return integer
*/
public function getTechnicalDataSheetFileSize() {
return $this->technicalDataSheetFileSize;
}
/**
* Set technicalDataSheetFileUpdatedAt
*
* @param DateTime $technicalDataSheetFileUpdatedAt
*
* @return TechnicalDataSheet
*/
public function setTechnicalDataSheetFileUpdatedAt($technicalDataSheetFileUpdatedAt) {
$this->technicalDataSheetFileUpdatedAt = $technicalDataSheetFileUpdatedAt;
return $this;
}
/**
* Get technicalDataSheetFileUpdatedAt
*
* @return DateTime
*/
public function getTechnicalDataSheetFileUpdatedAt() {
return $this->technicalDataSheetFileUpdatedAt;
}
/**
* Set createdAt
*
* @param DateTime $createdAt
*
* @return TechnicalDataSheet
*/
public function setCreatedAt($createdAt) {
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return DateTime
*/
public function getCreatedAt() {
return $this->createdAt;
}
/**
* Set isDeleted
*
* @param boolean $isDeleted
*
* @return TechnicalDataSheet
*/
public function setIsDeleted($isDeleted)
{
$this->isDeleted = $isDeleted;
return $this;
}
/**
* Get isDeleted
*
* @return boolean
*/
public function getIsDeleted()
{
return $this->isDeleted;
}
}