src/Entity/Dossiers/Fiches.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Dossiers;
  3. use Doctrine\DBAL\Types\Types;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * Fiches
  9.  *
  10.  * @ORM\Table("dossiers_fiches")
  11.  * @ORM\Entity(repositoryClass="App\Repository\Dossiers\FichesRepository")
  12.  * @ORM\HasLifecycleCallbacks()
  13.  */
  14. class Fiches
  15. {
  16.     /**
  17.      * @var integer
  18.      *
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     protected $id;
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  28.      */
  29.     private $createdAt;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  34.      */
  35.     private $updatedAt;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="identifiant", type="string", length=255, nullable=true)
  40.      */
  41.     private $identifiant;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="title", type="string", length=255, nullable=true)
  46.      */
  47.     private $title;
  48.     /**
  49.      * @var \FichesCategories
  50.      *
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\Dossiers\FichesCategories")
  52.      * @ORM\JoinColumns({
  53.      *   @ORM\JoinColumn(name="category_id", referencedColumnName="id", nullable=true)
  54.      * })
  55.      */
  56.     protected $category;
  57.     /**
  58.      * @var \Models
  59.      *
  60.      * @ORM\ManyToOne(targetEntity="App\Entity\Dossiers\Models")
  61.      * @ORM\JoinColumns({
  62.      *   @ORM\JoinColumn(name="model_id", referencedColumnName="id", nullable=true)
  63.      * })
  64.      */
  65.     protected $model;
  66.     /**
  67.      * @ORM\PrePersist
  68.      */
  69.     public function setCreatedAtValue(): void
  70.     {
  71.         $this->setCreatedAt(new \DateTime("now"));
  72.         $this->setUpdatedAt(new \DateTime("now"));
  73.     }
  74.     /**
  75.      * @ORM\PreUpdate
  76.      */
  77.     public function setUpdatedAtValue(): void
  78.     {
  79.         $this->setUpdatedAt(new \DateTime("now"));
  80.     }
  81.     public function __toString()
  82.     {
  83.         return (string)$this->title;
  84.     }
  85.     public function getTitleDocument(): ?string
  86.     {
  87.         return $this->getCategory()->getPrefix()."-".$this->getIdentifiant().' ('.$this->getCategory()->getTitle().')';
  88.     }
  89.     public function getId(): ?int
  90.     {
  91.         return $this->id;
  92.     }
  93.     public function getCreatedAt(): ?\DateTimeInterface
  94.     {
  95.         return $this->createdAt;
  96.     }
  97.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  98.     {
  99.         $this->createdAt $createdAt;
  100.         return $this;
  101.     }
  102.     public function getUpdatedAt(): ?\DateTimeInterface
  103.     {
  104.         return $this->updatedAt;
  105.     }
  106.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  107.     {
  108.         $this->updatedAt $updatedAt;
  109.         return $this;
  110.     }
  111.     public function getIdentifiant(): ?string
  112.     {
  113.         return $this->identifiant;
  114.     }
  115.     public function setIdentifiant(?string $identifiant): self
  116.     {
  117.         $this->identifiant $identifiant;
  118.         return $this;
  119.     }
  120.     public function getTitle(): ?string
  121.     {
  122.         return $this->title;
  123.     }
  124.     public function setTitle(?string $title): self
  125.     {
  126.         $this->title $title;
  127.         return $this;
  128.     }
  129.     public function getCategory(): ?FichesCategories
  130.     {
  131.         return $this->category;
  132.     }
  133.     public function setCategory(?FichesCategories $category): self
  134.     {
  135.         $this->category $category;
  136.         return $this;
  137.     }
  138.     public function getModel(): ?Models
  139.     {
  140.         return $this->model;
  141.     }
  142.     public function setModel(?Models $model): self
  143.     {
  144.         $this->model $model;
  145.         return $this;
  146.     }
  147. }