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