<?php
namespace App\Entity\Kanban;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use App\Annotations\SecuredEntity;
/**
* Colonne
*
* @ORM\Table("kanban__colonne")
* @ORM\Entity(repositoryClass="App\Repository\Kanban\ColonneRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity(name="Colonne", group="TACHES")
*/
class Colonne
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(name="libelle", type="string", length=255, nullable=true)
* @Assert\NotBlank(message="Libellé obligatoire")
*/
private $libelle;
/**
* @ORM\Column(name="delai", type="float", nullable=true)
*/
private $delai;
/**
* @ORM\Column(name="probabilite", type="integer", nullable=true)
*/
private $probabilite;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
*
* @ORM\ManyToOne(targetEntity="App\Entity\Kanban\Kanban")
* @ORM\JoinColumn(nullable=true)
*/
private $kanban;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Kanban\Kanban")
* @ORM\JoinColumn(nullable=true)
*/
private $kanbanEnfant;
/**
* @ORM\Column(name="position", type="integer", nullable=true)
* @Assert\NotBlank(message="La position ne peut ĂȘtre vide")
*/
private $position;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Kanban\Fiche", mappedBy="colonne")
* @ORM\JoinColumn(nullable=true)
*/
private $fiches;
public function __construct()
{
$this->date = new Datetime();
$this->fiches = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(?string $libelle): Colonne
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDate(?DateTime $date): Colonne
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): Colonne
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setPosition(?int $position): Colonne
{
$this->position = $position;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setKanban(?Kanban $kanban): Colonne
{
$this->kanban = $kanban;
return $this;
}
public function getKanban(): ?Kanban
{
return $this->kanban;
}
public function addFich(Fiche $fich): Colonne
{
$this->fiches[] = $fich;
return $this;
}
public function removeFich(Fiche $fich)
{
$this->fiches->removeElement($fich);
}
public function getFiches(): Collection
{
return $this->fiches;
}
public function __toString()
{
$libelle = $this->libelle;
if(is_object($this->kanban)) $libelle = $this->kanban->getLibelle().' : '.$libelle;
return $libelle;
}
public function setDelai(?float $delai): Colonne
{
$this->delai = $delai;
return $this;
}
public function getDelai(): ?float
{
return $this->delai;
}
public function setProbabilite(?int $probabilite): Colonne
{
$this->probabilite = $probabilite;
return $this;
}
public function getProbabilite(): ?int
{
return $this->probabilite;
}
public function setKanbanEnfant(?Kanban $kanbanEnfant): Colonne
{
$this->kanbanEnfant = $kanbanEnfant;
return $this;
}
public function getKanbanEnfant(): ?Kanban
{
return $this->kanbanEnfant;
}
}