src/Entity/Rangements/NiveauDeux.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Rangements;
  3. use App\Entity\Articles\Article;
  4. use App\Entity\Utilisateur\Utilisateur;
  5. use DateTime;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  12. use App\Annotations\SecuredEntity;
  13. /**
  14.  * NiveauDeux
  15.  *
  16.  * @ORM\Table("rangement__niveau_deux")
  17.  * @ORM\Entity(repositoryClass="App\Repository\Rangements\NiveauDeuxRepository")
  18.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  19.  * @SecuredEntity (name="Niveau 2", group="RANGEMENT")
  20.  */
  21. class NiveauDeux
  22. {
  23.     /**
  24.      * @ORM\Column(name="id", type="integer")
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue(strategy="AUTO")
  27.      */
  28.     private $id;
  29.     
  30.     /**
  31.      * @ORM\Column(name="code_barres", type="string", length=255,nullable=true)
  32.      */
  33.     private $codeBarres;
  34.     
  35.     /**
  36.      * @ORM\OneToMany(targetEntity="App\Entity\Articles\Article", mappedBy="niveauDeux")
  37.      */
  38.     private $articles;
  39.         
  40.     /**
  41.      * @ORM\OneToMany(targetEntity="App\Entity\Rangements\Emplacement", mappedBy="niveauDeux")
  42.      */
  43.     private $emplacements;
  44.     
  45.     /**
  46.      * @ORM\OneToMany(targetEntity="App\Entity\Rangements\NiveauTrois", mappedBy="niveauDeux")
  47.      */
  48.     private $niveauTrois;
  49.     
  50.     /**
  51.      * @ORM\OneToMany(targetEntity="App\Entity\Rangements\NiveauQuatre", mappedBy="niveauDeux")
  52.      */
  53.     private $niveauQuatre;
  54.     
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity="App\Entity\Rangements\NiveauUn", inversedBy="niveauDeux")
  57.      * @ORM\JoinColumn(nullable=true)
  58.      * @Assert\NotBlank(message="Choix du niveau 1 obligatoire")
  59.      */
  60.     private $niveauUn;
  61.     
  62.     /**
  63.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="rangementNiveauDeux")
  64.      * @ORM\JoinColumn(nullable=true)
  65.      */
  66.     private $utilisateur;
  67.     /**
  68.      * @ORM\Column(name="libelle", type="string", length=255)
  69.      * @Assert\NotBlank(message="Libelle obligatoire")
  70.      */
  71.     private $libelle;
  72.     /**
  73.      * @ORM\Column(name="date", type="datetime")
  74.      */
  75.     private $date;
  76.     /**
  77.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  78.      * @Gedmo\Timestampable(on="update")
  79.      */
  80.     private $dateMaj;
  81.     /**
  82.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  83.      */
  84.     private $dateSuppression;
  85.     /**
  86.      * @ORM\Column(name="priorite", type="integer", nullable=true)
  87.      */
  88.     private $priorite;
  89.     
  90.     public function __construct()
  91.     {
  92.         $this->date         = new Datetime();
  93.         $this->emplacements = new ArrayCollection();
  94.         $this->articles     = new ArrayCollection();
  95.         $this->niveauQuatre = new ArrayCollection();
  96.         $this->niveauTrois  = new ArrayCollection();
  97.     }
  98.     public function getId(): int
  99.     {
  100.         return $this->id;
  101.     }
  102.     public function setLibelle(string $libelle): NiveauDeux
  103.     {
  104.         $this->libelle $libelle;
  105.         return $this;
  106.     }
  107.     public function getLibelle(): string
  108.     {
  109.         return $this->libelle;
  110.     }
  111.     public function setDate(DateTime $date): NiveauDeux
  112.     {
  113.         $this->date $date;
  114.         return $this;
  115.     }
  116.     public function getDate(): DateTime
  117.     {
  118.         return $this->date;
  119.     }
  120.     public function setDateMaj(?DateTime $dateMaj): NiveauDeux
  121.     {
  122.         $this->dateMaj $dateMaj;
  123.         return $this;
  124.     }
  125.     public function getDateMaj(): ?DateTime
  126.     {
  127.         return $this->dateMaj;
  128.     }
  129.     public function setDateSuppression(?DateTime $dateSuppression): NiveauDeux
  130.     {
  131.         $this->dateSuppression $dateSuppression;
  132.         return $this;
  133.     }
  134.     public function getDateSuppression(): ?DateTime
  135.     {
  136.         return $this->dateSuppression;
  137.     }
  138.     
  139.     public function __toString() {
  140.         return $this->libelle;
  141.     }    
  142.     public function setNiveauUn(?niveauUn $niveauUn): NiveauDeux
  143.     {
  144.         $this->niveauUn $niveauUn;
  145.         return $this;
  146.     }
  147.     public function getNiveauUn(): ?niveauUn
  148.     {
  149.         return $this->niveauUn;
  150.     }
  151.     public function setUtilisateur(?Utilisateur $utilisateur): NiveauDeux
  152.     {
  153.         $this->utilisateur $utilisateur;
  154.         return $this;
  155.     }
  156.     public function getUtilisateur(): ?Utilisateur
  157.     {
  158.         return $this->utilisateur;
  159.     }
  160.     public function addNiveauTrois(niveauTrois $niveauTrois): NiveauDeux
  161.     {
  162.         $this->niveauTrois[] = $niveauTrois;
  163.         return $this;
  164.     }
  165.     public function removeNiveauTrois(niveauTrois $niveauTrois)
  166.     {
  167.         $this->niveauTrois->removeElement($niveauTrois);
  168.     }
  169.     public function getNiveauTrois(): Collection
  170.     {
  171.         return $this->niveauTrois;
  172.     }
  173.     public function addNiveauQuatre(niveauQuatre $niveauQuatre): NiveauDeux
  174.     {
  175.         $this->niveauQuatre[] = $niveauQuatre;
  176.         return $this;
  177.     }
  178.     public function removeNiveauQuatre(niveauQuatre $niveauQuatre)
  179.     {
  180.         $this->niveauQuatre->removeElement($niveauQuatre);
  181.     }
  182.     public function getNiveauQuatre(): Collection
  183.     {
  184.         return $this->niveauQuatre;
  185.     }
  186.     public function addArticle(Article $articles): NiveauDeux
  187.     {
  188.         $this->articles[] = $articles;
  189.         return $this;
  190.     }
  191.     public function removeArticle(Article $articles)
  192.     {
  193.         $this->articles->removeElement($articles);
  194.     }
  195.     public function getArticles(): Collection
  196.     {
  197.         return $this->articles;
  198.     }
  199.     public function setCodeBarres(?string $codeBarres): NiveauDeux
  200.     {
  201.         $this->codeBarres $codeBarres;
  202.         return $this;
  203.     }
  204.     public function getCodeBarres(): ?string
  205.     {
  206.         return $this->codeBarres;
  207.     }
  208.     public function addEmplacement(Emplacement $emplacement): NiveauDeux
  209.     {
  210.         $this->emplacements[] = $emplacement;
  211.         return $this;
  212.     }
  213.     public function removeEmplacement(Emplacement $emplacement)
  214.     {
  215.         $this->emplacements->removeElement($emplacement);
  216.     }
  217.     public function getEmplacements()
  218.     {
  219.         return $this->emplacements;
  220.     }
  221.     public function setPriorite(?int $priorite): NiveauDeux
  222.     {
  223.         $this->priorite $priorite;
  224.         return $this;
  225.     }
  226.     public function getPriorite(): ?int
  227.     {
  228.         return $this->priorite;
  229.     }
  230. }