src/Entity/Kanban/Colonne.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Kanban;
  3. use DateTime;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use App\Annotations\SecuredEntity;
  10. /**
  11.  * Colonne
  12.  *
  13.  * @ORM\Table("kanban__colonne")
  14.  * @ORM\Entity(repositoryClass="App\Repository\Kanban\ColonneRepository")
  15.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  16.  * @SecuredEntity(name="Colonne", group="TACHES")
  17.  */
  18. class Colonne
  19. {
  20.     /**
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  28.      * @Assert\NotBlank(message="LibellĂ© obligatoire")     
  29.      */
  30.     private $libelle;
  31.     
  32.     /**
  33.      * @ORM\Column(name="delai", type="float", nullable=true)
  34.      */
  35.     private $delai;
  36.     
  37.     /**
  38.      * @ORM\Column(name="probabilite", type="integer", nullable=true)
  39.      */
  40.     private $probabilite;    
  41.     /**
  42.      * @ORM\Column(name="date", type="datetime", nullable=true)
  43.      */
  44.     private $date;
  45.     /**
  46.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  47.      */
  48.     private $dateSuppression;
  49.     
  50.     /**
  51.      *
  52.      * @ORM\ManyToOne(targetEntity="App\Entity\Kanban\Kanban")
  53.      * @ORM\JoinColumn(nullable=true)
  54.      */
  55.     private $kanban;
  56.     
  57.     /**
  58.      * @ORM\ManyToOne(targetEntity="App\Entity\Kanban\Kanban")
  59.      * @ORM\JoinColumn(nullable=true)
  60.      */
  61.     private $kanbanEnfant;
  62.     
  63.     /**
  64.      * @ORM\Column(name="position", type="integer", nullable=true)
  65.      * @Assert\NotBlank(message="La position ne peut ĂȘtre vide")
  66.      */
  67.     private $position;
  68.     
  69.     /**
  70.      * @ORM\OneToMany(targetEntity="App\Entity\Kanban\Fiche", mappedBy="colonne")
  71.      * @ORM\JoinColumn(nullable=true)
  72.      */
  73.     private $fiches;
  74.     public function __construct()
  75.     {
  76.         $this->date     = new Datetime();
  77.         $this->fiches    = new ArrayCollection();
  78.     }
  79.     public function getId(): int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function setLibelle(?string $libelle): Colonne
  84.     {
  85.         $this->libelle $libelle;
  86.         return $this;
  87.     }
  88.     public function getLibelle(): ?string
  89.     {
  90.         return $this->libelle;
  91.     }
  92.     public function setDate(?DateTime $date): Colonne
  93.     {
  94.         $this->date $date;
  95.         return $this;
  96.     }
  97.     public function getDate(): ?DateTime
  98.     {
  99.         return $this->date;
  100.     }
  101.     public function setDateSuppression(?DateTime $dateSuppression): Colonne
  102.     {
  103.         $this->dateSuppression $dateSuppression;
  104.         return $this;
  105.     }
  106.     public function getDateSuppression(): ?DateTime
  107.     {
  108.         return $this->dateSuppression;
  109.     }
  110.     public function setPosition(?int $position): Colonne
  111.     {
  112.         $this->position $position;
  113.         return $this;
  114.     }
  115.     public function getPosition(): ?int
  116.     {
  117.         return $this->position;
  118.     }
  119.     public function setKanban(?Kanban $kanban): Colonne
  120.     {
  121.         $this->kanban $kanban;
  122.         return $this;
  123.     }
  124.     public function getKanban(): ?Kanban
  125.     {
  126.         return $this->kanban;
  127.     }
  128.     public function addFich(Fiche $fich): Colonne
  129.     {
  130.         $this->fiches[] = $fich;
  131.         return $this;
  132.     }
  133.     public function removeFich(Fiche $fich)
  134.     {
  135.         $this->fiches->removeElement($fich);
  136.     }
  137.     public function getFiches(): Collection
  138.     {
  139.         return $this->fiches;
  140.     }
  141.     
  142.     public function __toString()
  143.     {
  144.         $libelle $this->libelle;
  145.         if(is_object($this->kanban)) $libelle $this->kanban->getLibelle().' : '.$libelle;
  146.         return $libelle;
  147.     }
  148.     public function setDelai(?float $delai): Colonne
  149.     {
  150.         $this->delai $delai;
  151.         return $this;
  152.     }
  153.     public function getDelai(): ?float
  154.     {
  155.         return $this->delai;
  156.     }
  157.     public function setProbabilite(?int $probabilite): Colonne
  158.     {
  159.         $this->probabilite $probabilite;
  160.         return $this;
  161.     }
  162.     public function getProbabilite(): ?int
  163.     {
  164.         return $this->probabilite;
  165.     }
  166.     public function setKanbanEnfant(?Kanban $kanbanEnfant): Colonne
  167.     {
  168.         $this->kanbanEnfant $kanbanEnfant;
  169.         return $this;
  170.     }
  171.     public function getKanbanEnfant(): ?Kanban
  172.     {
  173.         return $this->kanbanEnfant;
  174.     }
  175. }