<?phpnamespace App\Entity\Dossiers;use Doctrine\DBAL\Types\Types;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;use Doctrine\ORM\Mapping as ORM;/** * Fiches * * @ORM\Table("dossiers_fiches") * @ORM\Entity(repositoryClass="App\Repository\Dossiers\FichesRepository") * @ORM\HasLifecycleCallbacks() */class Fiches{ /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @var string * * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"}) */ private $createdAt; /** * @var string * * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"}) */ private $updatedAt; /** * @var string * * @ORM\Column(name="identifiant", type="string", length=255, nullable=true) */ private $identifiant; /** * @var string * * @ORM\Column(name="title", type="string", length=255, nullable=true) */ private $title; /** * @var \FichesCategories * * @ORM\ManyToOne(targetEntity="App\Entity\Dossiers\FichesCategories") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="category_id", referencedColumnName="id", nullable=true) * }) */ protected $category; /** * @var \Models * * @ORM\ManyToOne(targetEntity="App\Entity\Dossiers\Models") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="model_id", referencedColumnName="id", nullable=true) * }) */ protected $model; /** * @ORM\PrePersist */ public function setCreatedAtValue(): void { $this->setCreatedAt(new \DateTime("now")); $this->setUpdatedAt(new \DateTime("now")); } /** * @ORM\PreUpdate */ public function setUpdatedAtValue(): void { $this->setUpdatedAt(new \DateTime("now")); } public function __toString() { return (string)$this->title; } public function getTitleDocument(): ?string { return $this->getCategory()->getPrefix()."-".$this->getIdentifiant().' ('.$this->getCategory()->getTitle().')'; } public function getId(): ?int { return $this->id; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(?\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getIdentifiant(): ?string { return $this->identifiant; } public function setIdentifiant(?string $identifiant): self { $this->identifiant = $identifiant; return $this; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): self { $this->title = $title; return $this; } public function getCategory(): ?FichesCategories { return $this->category; } public function setCategory(?FichesCategories $category): self { $this->category = $category; return $this; } public function getModel(): ?Models { return $this->model; } public function setModel(?Models $model): self { $this->model = $model; return $this; }}