src/Entity/Project.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. /**
  8.  * @ORM\Entity(repositoryClass=App\Repository\ProjectRepository::class)
  9.  * @ORM\Table(name="project", schema="bdnf", options={"comment":"Contient les projets"})
  10.  */
  11. class Project
  12. {
  13.     public function __construct()
  14.     {
  15.         $this->images = new ArrayCollection();
  16.     }
  17.     public function __toString()
  18.     {
  19.         return $this->getTitle();
  20.     }
  21.     public function toArray()
  22.     {
  23.         return [
  24.             'id' => $this->getId(),
  25.             'code' => $this->getCode(),
  26.             'title' => $this->getTitle(),
  27.             'dateCreation' => $this->getDateCreation(),
  28.             'datePublication' => $this->getDatePublication(),
  29.             'fileName' => $this->getFileName(),
  30.             'active' => $this->getActive(),
  31.             'lastUpdate' => $this->getLastUpdate()
  32.         ];
  33.     }
  34.     /**
  35.      * @ORM\Id
  36.      * @ORM\GeneratedValue
  37.      * @ORM\Column(type="integer", options={"comment":"Identifiant unique du projet"})
  38.      */
  39.     private $id;
  40.     /**
  41.      * @ORM\Column(type="boolean", options={"comment":"Indique si le projet est actif ou non"})
  42.      */
  43.     private $active true;
  44.     /**
  45.      * @ORM\Column(type="string",unique=true, options={"comment":"Code du projet"})
  46.      */
  47.     private $code;
  48.     /**
  49.      * @ORM\Column(type="string", options={"comment":"Titre du projet"})
  50.      */
  51.     private $title;
  52.     /**
  53.      * @ORM\Column(type="string", options={"comment":"Type du projet"})
  54.      */
  55.     private $type;
  56.     /**
  57.      * @ORM\Column(type="string", options={"comment":"Nom du fichier"})
  58.      */
  59.     private $fileName;
  60.     /**
  61.      * @Vich\UploadableField(mapping="fileName", fileNameProperty="fileName")
  62.      * @var File
  63.      */
  64.     private $file;
  65.     /**
  66.      * @ORM\Column(type="datetime", nullable=true, options={"comment":"Date de création du projet"})
  67.      */
  68.     private $dateCreation;
  69.     /**
  70.      * @ORM\Column(type="datetime", nullable=true, options={"comment":"Date de publication du projet"})
  71.      */
  72.     private $datePublication;
  73.     /**
  74.      * @ORM\Column(type="datetime", nullable=true, options={"comment":"Date de la dernière mise à jour du projet"})
  75.      */
  76.     private $lastUpdate;
  77.     /**
  78.      * @return mixed
  79.      */
  80.     public function getId()
  81.     {
  82.         return $this->id;
  83.     }
  84.     /**
  85.      * @param mixed $id
  86.      */
  87.     public function setId($id): void
  88.     {
  89.         $this->id $id;
  90.     }
  91.     /**
  92.      * @return mixed
  93.      */
  94.     public function getActive()
  95.     {
  96.         return $this->active;
  97.     }
  98.     /**
  99.      * @param mixed $active
  100.      */
  101.     public function setActive($active): void
  102.     {
  103.         $this->active $active;
  104.     }
  105.     /**
  106.      * @return mixed
  107.      */
  108.     public function getTitle()
  109.     {
  110.         return $this->title;
  111.     }
  112.     /**
  113.      * @param mixed $title
  114.      */
  115.     public function setTitle($title): void
  116.     {
  117.         $this->title $title;
  118.     }
  119.     /**
  120.      * @return mixed
  121.      */
  122.     public function getFileName()
  123.     {
  124.         return $this->fileName;
  125.     }
  126.     /**
  127.      * @param mixed $fileName
  128.      */
  129.     public function setFileName($fileName): void
  130.     {
  131.         $this->fileName $fileName;
  132.     }
  133.     /**
  134.      * @return File
  135.      */
  136.     public function getFile(): File
  137.     {
  138.         return $this->file;
  139.     }
  140.     /**
  141.      * @param File $file
  142.      */
  143.     public function setFile(File $file): void
  144.     {
  145.         $this->file $file;
  146.     }
  147.     /**
  148.      * @return mixed
  149.      */
  150.     public function getDateCreation()
  151.     {
  152.         return $this->dateCreation;
  153.     }
  154.     /**
  155.      * @param mixed $dateCreation
  156.      */
  157.     public function setDateCreation($dateCreation): void
  158.     {
  159.         $this->dateCreation $dateCreation;
  160.     }
  161.     /**
  162.      * @return mixed
  163.      */
  164.     public function getDatePublication()
  165.     {
  166.         return $this->datePublication;
  167.     }
  168.     /**
  169.      * @param mixed $datePublication
  170.      */
  171.     public function setDatePublication($datePublication): void
  172.     {
  173.         $this->datePublication $datePublication;
  174.     }
  175.     /**
  176.      * @return mixed
  177.      */
  178.     public function getLastUpdate()
  179.     {
  180.         return $this->lastUpdate;
  181.     }
  182.     /**
  183.      * @param mixed $lastUpdate
  184.      */
  185.     public function setLastUpdate($lastUpdate): void
  186.     {
  187.         $this->lastUpdate $lastUpdate;
  188.     }
  189.     /**
  190.      * @return mixed
  191.      */
  192.     public function getCode()
  193.     {
  194.         return $this->code;
  195.     }
  196.     /**
  197.      * @param mixed $code
  198.      */
  199.     public function setCode($code): void
  200.     {
  201.         $this->code $code;
  202.     }
  203.     /**
  204.      * @return mixed
  205.      */
  206.     public function getType()
  207.     {
  208.         return $this->type;
  209.     }
  210.     /**
  211.      * @param mixed $type
  212.      */
  213.     public function setType($type): void
  214.     {
  215.         $this->type $type;
  216.     }
  217. }