src/Entity/Inventaires/Inventaire.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Inventaires;
  3. use App\Entity\Articles\Marque;
  4. use App\Entity\Articles\MouvementStock;
  5. use App\Entity\Rangements\Emplacement;
  6. use App\Entity\Utilisateur\Utilisateur;
  7. use DateTime;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Gedmo\Mapping\Annotation as Gedmo;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. use App\Annotations\SecuredEntity;
  14. /**
  15.  * Inventaire
  16.  *
  17.  * @ORM\Table("inventaire__inventaire")
  18.  * @ORM\Entity(repositoryClass="App\Repository\Inventaires\InventaireRepository")
  19.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  20.  * @SecuredEntity(name="Inventaire", group="INVENTAIRES")
  21.  */
  22. class Inventaire
  23. {
  24.     /**
  25.      * @ORM\Column(name="id", type="integer")
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="AUTO")
  28.      */
  29.     private $id;
  30.     /**
  31.     * @ORM\OneToMany(targetEntity="App\Entity\Inventaires\ArticleInventaire", mappedBy="inventaire")
  32.     */
  33.     private $articleInventaire;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Marque", cascade={"persist"})
  36.      */
  37.     private $marque;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity="App\Entity\Inventaires\Type", inversedBy="inventaires")
  40.      * @ORM\JoinColumn(nullable=false)
  41.      */
  42.     private $type;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="inventaires")
  45.      * @ORM\JoinColumn(nullable=true)
  46.      */
  47.     private $utilisateur;
  48.     /**
  49.      * @ORM\Column(name="dateCloture", type="datetime", nullable=true)
  50.      */
  51.     private $dateCloture;
  52.     /**
  53.      * @ORM\Column(name="date", type="datetime", nullable=true)
  54.      */
  55.     private $date;
  56.     /**
  57.      * @ORM\Column(name="date_inventaire", type="datetime", nullable=true)
  58.      */
  59.     private $dateInventaire;
  60.     /**
  61.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  62.      */
  63.     private $libelle;
  64.     /**
  65.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  66.      */
  67.     private $dateSuppression;
  68.     /**
  69.      * @ORM\Column(name="statut", type="boolean", nullable=true)
  70.      */
  71.     private $statut;
  72.     /**
  73.      * @ORM\Column(name="inclure_article_different_zero", options={"default":false}, type="boolean", nullable=true)
  74.      */
  75.     private $inclureArticleDifferentZero;
  76.     /**
  77.      * @ORM\Column(name="inclure_article_date_mouvement", options={"default":false}, type="boolean", nullable=true)
  78.      */
  79.     private $inclureArticleDateMouvement;
  80.     /**
  81.      * @ORM\Column(name="a_basculer", type="boolean", nullable=true)
  82.      */
  83.     private $aBasculer;
  84.     /**
  85.      * @ORM\ManyToOne(targetEntity="App\Entity\Rangements\Emplacement", cascade={"persist"}, inversedBy="inventaires")
  86.      * @ORM\JoinColumn(nullable=true)
  87.      */
  88.     private $emplacement;
  89.     /**
  90.     * @ORM\OneToMany(targetEntity="App\Entity\Articles\MouvementStock", cascade={"persist"}, mappedBy="inventaire")
  91.     */
  92.     private $mouvementsStock;
  93.     /**
  94.      * @ORM\Column(name="date_mouvement", type="datetime", nullable=true)
  95.      */
  96.     private $dateMouvement;
  97.     /**
  98.      * @ORM\Column(name="en_cours_traitement", type="boolean", nullable=true)
  99.      */
  100.     private $enCoursTraitement;
  101.     /**
  102.      * @ORM\Column(name="nbArticles", type="integer", nullable=true)
  103.      */
  104.     private $nbArticles;
  105.     public function __construct()
  106.     {
  107.         $this->date = new Datetime();
  108.             $this->dateInventaire       = new Datetime();
  109.             $date                       = new Datetime();
  110.             $date->sub(new \DateInterval('P3Y'));
  111.             $this->dateMouvement        $date;
  112.             $this->aBasculer            false;
  113.             $this->mouvementsStock      = new ArrayCollection();
  114.             $this->articleInventaire    = new ArrayCollection();
  115.     }
  116.     public function getId(): int
  117.     {
  118.         return $this->id;
  119.     }
  120.     public function setDate(?DateTime $date): Inventaire
  121.     {
  122.         $this->date $date;
  123.         return $this;
  124.     }
  125.     public function getDate(): ?DateTime
  126.     {
  127.         return $this->date;
  128.     }
  129.     public function setLibelle(?string $libelle): Inventaire
  130.     {
  131.         $this->libelle $libelle;
  132.         return $this;
  133.     }
  134.     public function getLibelle(): ?string
  135.     {
  136.         return $this->libelle;
  137.     }
  138.     public function setDateSuppression(?DateTime $dateSuppression): Inventaire
  139.     {
  140.         $this->dateSuppression $dateSuppression;
  141.         return $this;
  142.     }
  143.     public function getDateSuppression(): ?DateTime
  144.     {
  145.         return $this->dateSuppression;
  146.     }
  147.     public function setStatut(?bool $statut): Inventaire
  148.     {
  149.         $this->statut $statut;
  150.         return $this;
  151.     }
  152.     public function getStatut(): ?bool
  153.     {
  154.         return $this->statut;
  155.     }
  156.     public function setUtilisateur(?Utilisateur $utilisateur): Inventaire
  157.     {
  158.         $this->utilisateur $utilisateur;
  159.         return $this;
  160.     }
  161.     public function getUtilisateur(): ?Utilisateur
  162.     {
  163.         return $this->utilisateur;
  164.     }
  165.     public function addArticleInventaire(ArticleInventaire $articleInventaire): Inventaire
  166.     {
  167.         $this->articleInventaire[] = $articleInventaire;
  168.         $articleInventaire->setInventaire($this);
  169.         return $this;
  170.     }
  171.     public function removeArticleInventaire(ArticleInventaire $articleInventaire)
  172.     {
  173.         $this->articleInventaire->removeElement($articleInventaire);
  174.     }
  175.     public function getArticleInventaire(): Collection
  176.     {
  177.         return $this->articleInventaire;
  178.     }
  179.     public function setMarque(?Marque $marque): Inventaire
  180.     {
  181.         $this->marque $marque;
  182.         return $this;
  183.     }
  184.     public function getMarque(): ?Marque
  185.     {
  186.         return $this->marque;
  187.     }
  188.     public function setDateCloture(?DateTime $dateCloture): Inventaire
  189.     {
  190.         $this->dateCloture $dateCloture;
  191.         return $this;
  192.     }
  193.     public function getDateCloture(): ?DateTime
  194.     {
  195.         return $this->dateCloture;
  196.     }
  197.     public function setType(?Type $type): Inventaire
  198.     {
  199.         $this->type $type;
  200.         return $this;
  201.     }
  202.     public function getType(): ?Type
  203.     {
  204.         return $this->type;
  205.     }
  206.     public function setEmplacement(?Emplacement $emplacement): Inventaire
  207.     {
  208.         $this->emplacement $emplacement;
  209.         return $this;
  210.     }
  211.     public function getEmplacement(): ?Emplacement
  212.     {
  213.         return $this->emplacement;
  214.     }
  215.     public function addMouvementsStock(MouvementStock $mouvementsStock): Inventaire
  216.     {
  217.         $this->mouvementsStock[] = $mouvementsStock;
  218.         return $this;
  219.     }
  220.     public function removeMouvementsStock(MouvementStock $mouvementsStock)
  221.     {
  222.         $this->mouvementsStock->removeElement($mouvementsStock);
  223.     }
  224.     public function getMouvementsStock(): Collection
  225.     {
  226.         return $this->mouvementsStock;
  227.     }
  228.     public function setDateMouvement(?DateTime $dateMouvement): Inventaire
  229.     {
  230.         $this->dateMouvement $dateMouvement;
  231.         return $this;
  232.     }
  233.     public function getDateMouvement(): ?DateTime
  234.     {
  235.         return $this->dateMouvement;
  236.     }
  237.     public function setEnCoursTraitement(?bool $enCoursTraitement): Inventaire
  238.     {
  239.         $this->enCoursTraitement $enCoursTraitement;
  240.         return $this;
  241.     }
  242.     public function getEnCoursTraitement(): ?bool
  243.     {
  244.         return $this->enCoursTraitement;
  245.     }
  246.     public function setNbArticles(?int $nbArticles): Inventaire
  247.     {
  248.         $this->nbArticles $nbArticles;
  249.         return $this;
  250.     }
  251.     public function getNbArticles(): ?int
  252.     {
  253.         return $this->nbArticles;
  254.     }
  255.     public function setDateInventaire(?DateTime $dateInventaire): Inventaire
  256.     {
  257.         $this->dateInventaire $dateInventaire;
  258.         return $this;
  259.     }
  260.     public function getDateInventaire(): ?DateTime
  261.     {
  262.         return $this->dateInventaire;
  263.     }
  264.     public function setABasculer(?bool $aBasculer): Inventaire
  265.     {
  266.         $this->aBasculer $aBasculer;
  267.         return $this;
  268.     }
  269.     public function getABasculer(): ?bool
  270.     {
  271.         return $this->aBasculer;
  272.     }
  273.     public function setInclureArticleDifferentZero(?bool $inclureArticleDifferentZero): Inventaire
  274.     {
  275.         $this->inclureArticleDifferentZero $inclureArticleDifferentZero;
  276.         return $this;
  277.     }
  278.     public function getInclureArticleDifferentZero(): ?bool
  279.     {
  280.         return $this->inclureArticleDifferentZero;
  281.     }
  282.     public function setInclureArticleDateMouvement(?bool $inclureArticleDateMouvement): Inventaire
  283.     {
  284.         $this->inclureArticleDateMouvement $inclureArticleDateMouvement;
  285.         return $this;
  286.     }
  287.     public function getInclureArticleDateMouvement(): ?bool
  288.     {
  289.         return $this->inclureArticleDateMouvement;
  290.     }
  291. }