src/Entity/Remises/Remise.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Remises;
  3. use App\Entity\Articles\Article;
  4. use App\Entity\Clients\Client;
  5. use App\Entity\GestionComerciale\ArticleCommande;
  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.  * Remise
  16.  *
  17.  * @ORM\Table("remise__remise")
  18.  * @ORM\Entity(repositoryClass="App\Repository\Remises\RemiseRepository")
  19.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  20.  * @SecuredEntity(name="Remise", group="VENTES")
  21.  */
  22. class Remise
  23. {
  24.     /**
  25.      * @ORM\Column(name="id", type="integer")
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="AUTO")
  28.      */
  29.     private $id;
  30.     
  31.     /**
  32.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  33.      */
  34.     private $idImport;
  35.     
  36.     /**
  37.      * @ORM\OneToMany(targetEntity="App\Entity\Remises\CategorieRemiseClientRemise", mappedBy="remise")
  38.      */
  39.     private $categorieRemiseClientRemise;
  40.     
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="App\Entity\Remises\CategorieRemiseArticleRemise", mappedBy="remise")
  43.      */
  44.     private $categorieRemiseArticleRemise;
  45.     
  46.     /**
  47.      * @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\ArticleCommande", mappedBy="remiseInitial")
  48.      */
  49.     private $articleCommande;
  50.     
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity="App\Entity\Clients\Client", cascade={"persist"})
  53.      */
  54.     private $client;
  55.     
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Article", cascade={"persist"})
  58.      */
  59.     private $article;
  60.     
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity="App\Entity\Remises\Remise", cascade={"persist"})
  63.      * @ORM\JoinColumn(nullable=true)
  64.      */
  65.     private $parent;
  66.     
  67.     /**
  68.      * @ORM\Column(name="date_debut", type="datetime", nullable=true)
  69.      */
  70.     private $dateDebut;
  71.     
  72.     /**
  73.      * @ORM\Column(name="date_fin", type="datetime", nullable=true)
  74.      */
  75.     private $dateFin;
  76.     
  77.      /**
  78.      * @ORM\Column(name="montant", type="float", nullable=true)
  79.      */
  80.     private $montant;
  81.     
  82.     /**
  83.      * @ORM\Column(name="typeReduction", type="string", length=255)
  84.      */
  85.     private $typeReduction;
  86.     
  87.      /**
  88.      * @ORM\Column(name="montant_minimum_commande", type="float", nullable=true)
  89.      */
  90.     private $montantMinimumCommande;
  91.     
  92.     /**
  93.      * @ORM\Column(name="statut", type="boolean", nullable=true)
  94.      */
  95.     private $statut;
  96.     
  97.     /**
  98.      * @ORM\Column(name="description", type="text", nullable=true)
  99.     */
  100.     private $description;
  101.     
  102.     /**
  103.      * @ORM\Column(name="quantite_restante", type="integer", nullable=true)
  104.      */
  105.     private $quantiteRestante;
  106.     
  107.     /**
  108.      * @ORM\Column(name="quantite_total", type="integer", nullable=true)
  109.      */
  110.     private $quantiteTotal;
  111.     
  112.     /**
  113.      * @ORM\Column(name="quantite_max_personne", type="integer", nullable=true)
  114.      */
  115.     private $quantiteMaxPersonne;
  116.     /**
  117.      * @ORM\OneToMany(targetEntity="App\Entity\Remises\RemiseCategorieClient", mappedBy="remise")
  118.      */
  119.     private $remiseCategorieClient;
  120.     
  121.     /**
  122.      * @ORM\OneToMany(targetEntity="App\Entity\Remises\RemiseCategorieArticle", mappedBy="remise")
  123.      */
  124.     private $remiseCategorieArticle;
  125.     
  126.     /**
  127.      * @ORM\OneToMany(targetEntity="App\Entity\Remises\RemiseMarqueArticle", mappedBy="remise")
  128.      */
  129.     private $remiseMarqueArticle;
  130.     /**
  131.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="remises")
  132.      * @ORM\JoinColumn(nullable=true)
  133.      */
  134.     private $utilisateur;
  135.     /**
  136.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  137.      * @Assert\NotBlank(message="Référence obligatoire")
  138.      */
  139.     private $libelle;
  140.     /**
  141.      * @ORM\Column(name="date", type="datetime", nullable=true)
  142.      */
  143.     private $date;
  144.     /**
  145.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  146.      */
  147.     private $dateSuppression;
  148.     /**
  149.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  150.      * @Gedmo\Timestampable(on="update")
  151.      */
  152.     private $dateMaj;
  153.     
  154.     /**
  155.      * @ORM\Column(name="visible", type="boolean", nullable=true)
  156.      */
  157.     private $visible;
  158.     public function __construct()
  159.     {
  160.         $this->date                         = new Datetime();
  161.         $this->dateDebut                    = new Datetime();
  162.         $this->dateFin                      = new Datetime();
  163.         $this->statut                       true;
  164.         $this->visible                      true;
  165.         $this->montantMinimumCommande       0;
  166.         $this->quantiteMaxPersonne          1000000000;
  167.         $this->quantiteTotal                1000000000;
  168.         $this->quantiteRestante             1000000000;
  169.         $this->categorieRemiseArticleRemise = new ArrayCollection();
  170.         $this->categorieRemiseClientRemise  = new ArrayCollection();
  171.         $this->remiseMarqueArticle          = new ArrayCollection();
  172.         $this->remiseCategorieArticle       = new ArrayCollection();
  173.         $this->articleCommande              = new ArrayCollection();
  174.         $this->remiseCategorieClient        = new ArrayCollection();
  175.     }
  176.     public function getId(): int
  177.     {
  178.         return $this->id;
  179.     }
  180.     public function setLibelle(?string $libelle): Remise
  181.     {
  182.         $this->libelle $libelle;
  183.         return $this;
  184.     }
  185.     public function getLibelle(): ?string
  186.     {
  187.         return $this->libelle;
  188.     }
  189.     public function setDate(?Datetime $date): Remise
  190.     {
  191.         $this->date $date;
  192.         return $this;
  193.     }
  194.     public function getDate(): ?Datetime
  195.     {
  196.         return $this->date;
  197.     }
  198.     public function setDateSuppression(?Datetime $dateSuppression): Remise
  199.     {
  200.         $this->dateSuppression $dateSuppression;
  201.         return $this;
  202.     }
  203.     public function getDateSuppression(): ?Datetime
  204.     {
  205.         return $this->dateSuppression;
  206.     }
  207.     public function setDateMaj(?Datetime $dateMaj): Remise
  208.     {
  209.         $this->dateMaj $dateMaj;
  210.         return $this;
  211.     }
  212.     public function getDateMaj(): ?Datetime
  213.     {
  214.         return $this->dateMaj;
  215.     }
  216.     public function setUtilisateur(?Utilisateur $utilisateur): Remise
  217.     {
  218.         $this->utilisateur $utilisateur;
  219.         return $this;
  220.     }
  221.     public function getUtilisateur(): ?Utilisateur
  222.     {
  223.         return $this->utilisateur;
  224.     }
  225.     public function addRemiseCategorieClient(RemiseCategorieClient $remiseCategorieClient): Remise
  226.     {
  227.         $this->remiseCategorieClient[] = $remiseCategorieClient;
  228.         return $this;
  229.     }
  230.     public function removeRemiseCategorieClient(RemiseCategorieClient $remiseCategorieClient)
  231.     {
  232.         $this->remiseCategorieClient->removeElement($remiseCategorieClient);
  233.     }
  234.     public function getRemiseCategorieClient(): Collection
  235.     {
  236.         return $this->remiseCategorieClient;
  237.     }
  238.     public function setDateDebut(?Datetime $dateDebut): Remise
  239.     {
  240.         $this->dateDebut $dateDebut;
  241.         return $this;
  242.     }
  243.     public function getDateDebut(): ?Datetime
  244.     {
  245.         return $this->dateDebut;
  246.     }
  247.     public function setDateFin(?Datetime $dateFin): Remise
  248.     {
  249.         $this->dateFin $dateFin;
  250.         return $this;
  251.     }
  252.     public function getDateFin(): ?Datetime
  253.     {
  254.         return $this->dateFin;
  255.     }
  256.     public function setMontant(?float $montant): Remise
  257.     {
  258.         $this->montant $montant;
  259.         return $this;
  260.     }
  261.     public function getMontant(): ?float
  262.     {
  263.         return $this->montant;
  264.     }
  265.     public function setMontantMinimumCommande(?float $montantMinimumCommande): Remise
  266.     {
  267.         $this->montantMinimumCommande $montantMinimumCommande;
  268.         return $this;
  269.     }
  270.     public function getMontantMinimumCommande(): ?float
  271.     {
  272.         return $this->montantMinimumCommande;
  273.     }
  274.     public function setStatut(?bool $statut): Remise
  275.     {
  276.         $this->statut $statut;
  277.         return $this;
  278.     }
  279.     public function getStatut(): ?bool
  280.     {
  281.         return $this->statut;
  282.     }
  283.     public function setDescription(?string $description): Remise
  284.     {
  285.         $this->description $description;
  286.         return $this;
  287.     }
  288.     public function getDescription(): ?string
  289.     {
  290.         return $this->description;
  291.     }
  292.     public function setQuantiteTotal(?int $quantiteTotal): Remise
  293.     {
  294.         $this->quantiteTotal $quantiteTotal;
  295.         return $this;
  296.     }
  297.     public function getQuantiteTotal(): ?int
  298.     {
  299.         return $this->quantiteTotal;
  300.     }
  301.     public function setQuantiteMaxPersonne(?int $quantiteMaxPersonne): Remise
  302.     {
  303.         $this->quantiteMaxPersonne $quantiteMaxPersonne;
  304.         return $this;
  305.     }
  306.     public function getQuantiteMaxPersonne(): ?int
  307.     {
  308.         return $this->quantiteMaxPersonne;
  309.     }
  310.     public function setTypeReduction(string $typeReduction): Remise
  311.     {
  312.         $this->typeReduction $typeReduction;
  313.         return $this;
  314.     }
  315.     public function getTypeReduction(): string
  316.     {
  317.         return $this->typeReduction;
  318.     }
  319.     public function setParent(?Remise $parent): Remise
  320.     {
  321.         $this->parent $parent;
  322.         return $this;
  323.     }
  324.     public function getParent(): ?Remise
  325.     {
  326.         return $this->parent;
  327.     }
  328.     public function addArticleCommande(ArticleCommande $articleCommande): Remise
  329.     {
  330.         $this->articleCommande[] = $articleCommande;
  331.         return $this;
  332.     }
  333.     public function removeArticleCommande(ArticleCommande $articleCommande)
  334.     {
  335.         $this->articleCommande->removeElement($articleCommande);
  336.     }
  337.     public function getArticleCommande(): Collection
  338.     {
  339.         return $this->articleCommande;
  340.     }
  341.     public function setQuantiteRestante(?int $quantiteRestante): Remise
  342.     {
  343.         $this->quantiteRestante $quantiteRestante;
  344.         return $this;
  345.     }
  346.     public function getQuantiteRestante(): ?int
  347.     {
  348.         return $this->quantiteRestante;
  349.     }
  350.     public function setClient(?Client $client): Remise
  351.     {
  352.         $this->client $client;
  353.         return $this;
  354.     }
  355.     public function getClient(): ?Client
  356.     {
  357.         return $this->client;
  358.     }
  359.     public function addRemiseCategorieArticle(RemiseCategorieArticle $remiseCategorieArticle): Remise
  360.     {
  361.         $this->remiseCategorieArticle[] = $remiseCategorieArticle;
  362.         return $this;
  363.     }
  364.     public function removeRemiseCategorieArticle(RemiseCategorieArticle $remiseCategorieArticle)
  365.     {
  366.         $this->remiseCategorieArticle->removeElement($remiseCategorieArticle);
  367.     }
  368.     public function getRemiseCategorieArticle(): Collection
  369.     {
  370.         return $this->remiseCategorieArticle;
  371.     }
  372.     public function addRemiseMarqueArticle(RemiseMarqueArticle $remiseMarqueArticle): Remise
  373.     {
  374.         $this->remiseMarqueArticle[] = $remiseMarqueArticle;
  375.         return $this;
  376.     }
  377.     public function removeRemiseMarqueArticle(RemiseMarqueArticle $remiseMarqueArticle)
  378.     {
  379.         $this->remiseMarqueArticle->removeElement($remiseMarqueArticle);
  380.     }
  381.     public function getRemiseMarqueArticle(): Collection
  382.     {
  383.         return $this->remiseMarqueArticle;
  384.     }
  385.     public function addCategorieRemiseClientRemise(CategorieRemiseClientRemise $categorieRemiseClientRemise): Remise
  386.     {
  387.         $this->categorieRemiseClientRemise[] = $categorieRemiseClientRemise;
  388.         return $this;
  389.     }
  390.     public function removeCategorieRemiseClientRemise(CategorieRemiseClientRemise $categorieRemiseClientRemise)
  391.     {
  392.         $this->categorieRemiseClientRemise->removeElement($categorieRemiseClientRemise);
  393.     }
  394.     public function getCategorieRemiseClientRemise(): Collection
  395.     {
  396.         return $this->categorieRemiseClientRemise;
  397.     }
  398.     public function addCategorieRemiseArticleRemise(CategorieRemiseArticleRemise $categorieRemiseArticleRemise): Remise
  399.     {
  400.         $this->categorieRemiseArticleRemise[] = $categorieRemiseArticleRemise;
  401.         return $this;
  402.     }
  403.     public function removeCategorieRemiseArticleRemise(CategorieRemiseArticleRemise $categorieRemiseArticleRemise)
  404.     {
  405.         $this->categorieRemiseArticleRemise->removeElement($categorieRemiseArticleRemise);
  406.     }
  407.     public function getCategorieRemiseArticleRemise(): Collection
  408.     {
  409.         return $this->categorieRemiseArticleRemise;
  410.     }
  411.     public function setIdImport(?string $idImport): Remise
  412.     {
  413.         $this->idImport $idImport;
  414.         return $this;
  415.     }
  416.     public function getIdImport(): ?string
  417.     {
  418.         return $this->idImport;
  419.     }
  420.     public function setArticle(?Article $article): Remise
  421.     {
  422.         $this->article $article;
  423.         return $this;
  424.     }
  425.     public function getArticle(): ?Article
  426.     {
  427.         return $this->article;
  428.     }
  429.     public function setVisible(?bool $visible): Remise
  430.     {
  431.         $this->visible $visible;
  432.         return $this;
  433.     }
  434.     public function getVisible(): ?bool
  435.     {
  436.         return $this->visible;
  437.     }
  438. }