src/Entity/Rangements/NiveauUn.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.  * NiveauUn
  15.  *
  16.  * @ORM\Table("rangement__niveau_un")
  17.  * @ORM\Entity(repositoryClass="App\Repository\Rangements\NiveauUnRepository")
  18.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  19.  * @SecuredEntity (name="Niveau 1", group="RANGEMENT")
  20.  */
  21. class NiveauUn
  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.      * @ORM\OneToMany(targetEntity="App\Entity\Articles\Article", mappedBy="niveauUn")
  36.      */
  37.     private $articles;
  38.         
  39.         /**
  40.      * @ORM\OneToMany(targetEntity="App\Entity\Rangements\Emplacement", mappedBy="niveauUn")
  41.      */
  42.     private $emplacements;
  43.     
  44.     /**
  45.      * @ORM\OneToMany(targetEntity="App\Entity\Rangements\NiveauTrois", mappedBy="niveauUn")
  46.      */
  47.     private $niveauTrois;
  48.     
  49.     /**
  50.      * @ORM\OneToMany(targetEntity="App\Entity\Rangements\NiveauQuatre", mappedBy="niveauUn")
  51.      */
  52.     private $niveauQuatre;
  53.     
  54.     /**
  55.      * @ORM\OneToMany(targetEntity="App\Entity\Rangements\NiveauDeux", mappedBy="niveauUn")
  56.      */
  57.     private $niveauDeux;
  58.     /**
  59.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="rangementNiveauUn")
  60.      * @ORM\JoinColumn(nullable=true)
  61.      */
  62.     private $utilisateur;
  63.     /**
  64.      * @ORM\Column(name="libelle", type="string", length=255)
  65.      * @Assert\NotBlank(message="Libelle obligatoire")
  66.      */
  67.     private $libelle;
  68.     /**
  69.      * @ORM\Column(name="date", type="datetime")
  70.      */
  71.     private $date;
  72.     /**
  73.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  74.      * @Gedmo\Timestampable(on="update")
  75.      */
  76.     private $dateMaj;
  77.     /**
  78.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  79.      */
  80.     private $dateSuppression;
  81.     /**
  82.      * @ORM\Column(name="priorite", type="integer", nullable=true)
  83.      */
  84.     private $priorite;
  85.     public function __construct()
  86.     {
  87.         $this->date             = new Datetime();
  88.         $this->emplacements     = new ArrayCollection();
  89.         $this->articles         = new ArrayCollection();
  90.         $this->niveauQuatre     = new ArrayCollection();
  91.         $this->niveauTrois      = new ArrayCollection();
  92.         $this->niveauDeux       = new ArrayCollection();
  93.     }
  94.     public function getId(): int
  95.     {
  96.         return $this->id;
  97.     }
  98.     public function setLibelle(string $libelle): NiveauUn
  99.     {
  100.         $this->libelle $libelle;
  101.         return $this;
  102.     }
  103.     public function getLibelle(): string
  104.     {
  105.         return $this->libelle;
  106.     }
  107.     public function setDate(DateTime $date): NiveauUn
  108.     {
  109.         $this->date $date;
  110.         return $this;
  111.     }
  112.     public function getDate(): DateTime
  113.     {
  114.         return $this->date;
  115.     }
  116.     public function setDateMaj(?DateTime $dateMaj): NiveauUn
  117.     {
  118.         $this->dateMaj $dateMaj;
  119.         return $this;
  120.     }
  121.     public function getDateMaj(): ?DateTime
  122.     {
  123.         return $this->dateMaj;
  124.     }
  125.     public function setDateSuppression(?DateTime $dateSuppression): NiveauUn
  126.     {
  127.         $this->dateSuppression $dateSuppression;
  128.         return $this;
  129.     }
  130.     public function getDateSuppression(): ?DateTime
  131.     {
  132.         return $this->dateSuppression;
  133.     }
  134.     
  135.     public function __toString() {
  136.         return $this->libelle;
  137.     }
  138.     public function setUtilisateur(?Utilisateur $utilisateur): NiveauUn
  139.     {
  140.         $this->utilisateur $utilisateur;
  141.         return $this;
  142.     }
  143.     public function getUtilisateur(): ?Utilisateur
  144.     {
  145.         return $this->utilisateur;
  146.     }
  147.     public function addNiveauDeux(niveauDeux $niveauDeux): NiveauUn
  148.     {
  149.         $this->niveauDeux[] = $niveauDeux;
  150.         return $this;
  151.     }
  152.     public function removeNiveauDeux(niveauDeux $niveauDeux)
  153.     {
  154.         $this->niveauDeux->removeElement($niveauDeux);
  155.     }
  156.     public function getNiveauDeux(): Collection
  157.     {
  158.         return $this->niveauDeux;
  159.     }
  160.     public function addNiveauTrois(niveauTrois $niveauTrois): NiveauUn
  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): NiveauUn
  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): NiveauUn
  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): NiveauUn
  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): NiveauUn
  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(): Collection
  218.     {
  219.         return $this->emplacements;
  220.     }
  221.     public function setPriorite(?int $priorite): NiveauUn
  222.     {
  223.         $this->priorite $priorite;
  224.         return $this;
  225.     }
  226.     public function getPriorite(): ?int
  227.     {
  228.         return $this->priorite;
  229.     }
  230. }