src/Entity/Clients/Categorie.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Clients;
  3. use App\Entity\Articles\Compta;
  4. use App\Entity\Articles\PrixPromo;
  5. use App\Entity\Remises\RemiseCategorieClient;
  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.  * Categorie
  16.  *
  17.  * @ORM\Table("client__categorie")
  18.  * @ORM\Entity(repositoryClass="App\Repository\Clients\CategorieRepository")
  19.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  20.  * @SecuredEntity(name="Categorie", group="CLIENTS")
  21.  */
  22. class Categorie
  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\OneToMany(targetEntity="App\Entity\Articles\PrixPromo", mappedBy="categorieClient")
  33.      */
  34.     private $prixPromo;
  35.     
  36.     /**
  37.      * @ORM\Column(name="professionnel", type="boolean", nullable=true)
  38.      */
  39.     private $professionnel;
  40.     
  41.     /**
  42.      * @ORM\Column(name="modifiable", type="boolean", nullable=true)
  43.      */
  44.     private $modifiable;
  45.     /**
  46.      * @ORM\Column(name="idImport", type="string", length=255, nullable=true)
  47.      */
  48.     private $idImport;
  49.     
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\Clients\Categorie", cascade={"persist"}, inversedBy="categoriesEnfant" )
  52.      * @ORM\JoinColumn(nullable=true)
  53.      */
  54.     private $categorieParent;
  55.     
  56.     /**
  57.     * @ORM\OneToMany(targetEntity="App\Entity\Clients\Categorie", mappedBy="categorieParent")
  58.      * @ORM\OrderBy({"libelle" = "ASC"})
  59.     */
  60.     private $categoriesEnfant;    
  61.     
  62.     /**
  63.      * @ORM\OneToMany(targetEntity="App\Entity\Remises\RemiseCategorieClient", mappedBy="categorie")
  64.      */
  65.     private $remiseCategorieClient;
  66.     /**
  67.      * @ORM\OneToMany(targetEntity="App\Entity\Clients\ClientCategorie", mappedBy="categorie")
  68.      */
  69.     private $clientCategorie;
  70.     /**
  71.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="clientCategorie")
  72.      * @ORM\JoinColumn(nullable=true)
  73.      */
  74.     private $utilisateur;
  75.     /**
  76.      * @ORM\Column(name="date", type="datetime", nullable=true)
  77.      */
  78.     private $date;
  79.     /**
  80.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  81.      * @Assert\NotBlank(message="LibellĂ© obligatoire")
  82.      */
  83.     private $libelle;
  84.     /**
  85.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  86.      * @Gedmo\Timestampable(on="update")
  87.      */
  88.     private $dateMaj;
  89.     /**
  90.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  91.      */
  92.     private $dateSuppression;
  93.     /**
  94.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Compta", cascade={"persist"})
  95.      * @ORM\JoinColumn(nullable=true)
  96.      */
  97.     private $compta;
  98.     /**
  99.      * @var integer
  100.      *
  101.      * @ORM\Column(name="id_prestashop", type="string",length=255, nullable=true)
  102.      */
  103.     private $idPrestashop;
  104.     public function __construct()
  105.                 {
  106.                     $this->date                  = new Datetime();
  107.                     $this->modifiable             true;
  108.                     $this->categoriesEnfant      = new ArrayCollection();
  109.                     $this->prixPromo             = new ArrayCollection();
  110.                     $this->remiseCategorieClient = new ArrayCollection();
  111.                     $this->clientCategorie       = new ArrayCollection();
  112.                 }
  113.     public function getId(): int
  114.     {
  115.         return $this->id;
  116.     }
  117.     public function setDate(?Datetime $date): Categorie
  118.     {
  119.         $this->date $date;
  120.         return $this;
  121.     }
  122.     public function getDate(): ?Datetime
  123.     {
  124.         return $this->date;
  125.     }
  126.     public function setLibelle(?string $libelle): Categorie
  127.     {
  128.         $this->libelle $libelle;
  129.         return $this;
  130.     }
  131.     public function getLibelle(): ?string
  132.     {
  133.         return $this->libelle;
  134.     }
  135.     public function setDateMaj(?Datetime $dateMaj): Categorie
  136.     {
  137.         $this->dateMaj $dateMaj;
  138.         return $this;
  139.     }
  140.     public function getDateMaj(): ?Datetime
  141.     {
  142.         return $this->dateMaj;
  143.     }
  144.     public function setDateSuppression(?Datetime $dateSuppression): Categorie
  145.     {
  146.         $this->dateSuppression $dateSuppression;
  147.         return $this;
  148.     }
  149.     public function getDateSuppression(): ?Datetime
  150.     {
  151.         return $this->dateSuppression;
  152.     }
  153.     
  154.     public function __toString() {
  155.         return $this->libelle;
  156.     }
  157.     public function setUtilisateur(?Utilisateur $utilisateur null): Categorie
  158.     {
  159.         $this->utilisateur $utilisateur;
  160.         return $this;
  161.     }
  162.     public function getUtilisateur(): ?Utilisateur
  163.     {
  164.         return $this->utilisateur;
  165.     }
  166.     public function addClientCategorie(ClientCategorie $clientCategorie): Categorie
  167.     {
  168.         $this->clientCategorie[] = $clientCategorie;
  169.         return $this;
  170.     }
  171.     public function removeClientCategorie(ClientCategorie $clientCategorie)
  172.     {
  173.         $this->clientCategorie->removeElement($clientCategorie);
  174.     }
  175.     public function getClientCategorie(): Collection
  176.     {
  177.         return $this->clientCategorie;
  178.     }
  179.     public function addRemiseCategorieClient(RemiseCategorieClient $remiseCategorieClient): Categorie
  180.     {
  181.         $this->remiseCategorieClient[] = $remiseCategorieClient;
  182.         return $this;
  183.     }
  184.     public function removeRemiseCategorieClient(RemiseCategorieClient $remiseCategorieClient)
  185.     {
  186.         $this->remiseCategorieClient->removeElement($remiseCategorieClient);
  187.     }
  188.     public function getRemiseCategorieClient(): Collection
  189.     {
  190.         return $this->remiseCategorieClient;
  191.     }
  192.     public function setIdImport(?string $idImport): Categorie
  193.     {
  194.         $this->idImport $idImport;
  195.         return $this;
  196.     }
  197.     public function getIdImport(): ?string
  198.     {
  199.         return $this->idImport;
  200.     }
  201.     public function setCategorieParent(?Categorie $categorieParent): Categorie
  202.     {
  203.         $this->categorieParent $categorieParent;
  204.         return $this;
  205.     }
  206.     public function getCategorieParent(): ?Categorie
  207.     {
  208.         return $this->categorieParent;
  209.     }
  210.     public function addPrixPromo(PrixPromo $prixPromo): Categorie
  211.     {
  212.         $this->prixPromo[] = $prixPromo;
  213.         return $this;
  214.     }
  215.     public function removePrixPromo(PrixPromo $prixPromo)
  216.     {
  217.         $this->prixPromo->removeElement($prixPromo);
  218.     }
  219.     public function getPrixPromo(): Collection
  220.     {
  221.         return $this->prixPromo;
  222.     }
  223.     public function setModifiable(?bool $modifiable): Categorie
  224.     {
  225.         $this->modifiable $modifiable;
  226.         return $this;
  227.     }
  228.     public function getModifiable(): ?bool
  229.     {
  230.         return $this->modifiable;
  231.     }
  232.     public function setProfessionnel(?bool $professionnel): Categorie
  233.     {
  234.         $this->professionnel $professionnel;
  235.         return $this;
  236.     }
  237.     public function getProfessionnel(): ?bool
  238.     {
  239.         return $this->professionnel;
  240.     }
  241.     public function addCategoriesEnfant(Categorie $categoriesEnfant): Categorie
  242.     {
  243.         $this->categoriesEnfant[] = $categoriesEnfant;
  244.         return $this;
  245.     }
  246.     public function removeCategoriesEnfant(Categorie $categoriesEnfant)
  247.     {
  248.         $this->categoriesEnfant->removeElement($categoriesEnfant);
  249.     }
  250.     public function getCategoriesEnfant(): Collection
  251.     {
  252.         return $this->categoriesEnfant;
  253.     }    
  254.     public function setCompta(?Compta $compta): Categorie
  255.     {
  256.         $this->compta $compta;
  257.         return $this;
  258.     }
  259.     public function getCompta(): ?Compta
  260.     {
  261.         return $this->compta;
  262.     }
  263.     public function isProfessionnel(): ?bool
  264.     {
  265.         return $this->professionnel;
  266.     }
  267.     public function isModifiable(): ?bool
  268.     {
  269.         return $this->modifiable;
  270.     }
  271.     public function getIdPrestashop(): ?string
  272.     {
  273.         return $this->idPrestashop;
  274.     }
  275.     public function setIdPrestashop(?string $idPrestashop): self
  276.     {
  277.         $this->idPrestashop $idPrestashop;
  278.         return $this;
  279.     }
  280. }