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