src/Entity/Articles/Categorie.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use App\Entity\MarketPlace\MarketPlace;
  4. use App\Entity\MarketPlace\Profil;
  5. use App\Entity\Remises\RemiseCategorieArticle;
  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("article__categorie")
  18.  * @ORM\Entity(repositoryClass="App\Repository\Articles\CategorieRepository")
  19.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  20.  * @SecuredEntity(name="Catégories", group="ARTICLES")
  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\ManyToOne(targetEntity="App\Entity\MarketPlace\MarketPlace")
  33.      * @ORM\JoinColumn(nullable=true)
  34.      */
  35.     private $marketPlace;
  36.     
  37.     /**
  38.     * @ORM\ManyToOne(targetEntity="App\Entity\MarketPlace\Profil")
  39.     */
  40.     private $profilAmazon;
  41.     
  42.     /**
  43.      * @ORM\Column(name="reference", type="string", length=255)
  44.      * @Assert\NotBlank(message="Référence obligatoire")
  45.      */
  46.     private $reference;
  47.     
  48.     /**
  49.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  50.      */
  51.     private $idImport;
  52.     /**
  53.      * @var integer
  54.      *
  55.      * @ORM\Column(name="id_prestahop", type="string",length=255, nullable=true)
  56.      */
  57.     private $idPrestahop;
  58.     
  59.     /**
  60.      * @ORM\OneToMany(targetEntity="App\Entity\Remises\RemiseCategorieArticle", mappedBy="categorie")
  61.      */
  62.     private $remiseCategorieArticle;
  63.     
  64.     /**
  65.      * @ORM\OneToMany(targetEntity="App\Entity\Articles\ArticleCategorie", mappedBy="categorie")
  66.      */
  67.     private $articleCategorie;
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="categories")
  70.      * @ORM\JoinColumn(nullable=true)
  71.      */
  72.     private $utilisateur;
  73.     /**
  74.      * @ORM\Column(name="logo", type="string", length=255, nullable=true)
  75.      */
  76.     private $logo;
  77.     
  78.     /**
  79.      * @ORM\Column(name="logo2", type="string", length=255, nullable=true)
  80.      */
  81.     private $logo2;
  82.     /**
  83.      * @ORM\Column(name="libelle", type="string", length=255)
  84.      * @Assert\NotBlank(message="Libellé obligatoire")
  85.      */
  86.     private $libelle;
  87.     /**
  88.      * @ORM\Column(name="date", type="datetime", nullable=true)
  89.      */
  90.     private $date;
  91.     
  92.     /**
  93.      * @ORM\Column(name="date_supression", type="datetime", nullable=true)
  94.      */
  95.     private $dateSuppression;
  96.     /**
  97.      * @ORM\Column(name="date_maj", type="datetime", nullable=true)
  98.      * @Gedmo\Timestampable(on="update")
  99.      */
  100.     private $dateMaj;
  101.     /**
  102.      * @ORM\Column(name="statut", type="boolean", nullable=true)
  103.      */
  104.     private $statut;
  105.     
  106.     /**
  107.      * @ORM\Column(name="home_page_prestashop", type="boolean", nullable=true)
  108.      */
  109.     private $homePagePrestashop;
  110.     
  111.     /**
  112.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
  113.      * @ORM\JoinColumn(nullable=true)
  114.      */
  115.     private $categorieAmazon;
  116.     
  117.     /**
  118.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
  119.      * @ORM\JoinColumn(nullable=true)
  120.      */
  121.     private $categorieCdiscount;
  122.     
  123.     /**
  124.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
  125.      * @ORM\JoinColumn(nullable=true)
  126.      */
  127.     private $categoriePriceMinister;
  128.     
  129.     /**
  130.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
  131.      * @ORM\JoinColumn(nullable=true)
  132.      */
  133.     private $categorieEbay;
  134.     
  135.     /**
  136.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
  137.      * @ORM\JoinColumn(nullable=true)
  138.      */
  139.     private $categorieWordpress;
  140.     
  141.     /**
  142.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
  143.      * @ORM\JoinColumn(nullable=true)
  144.      */
  145.     private $categorieWordpressWoo;
  146.     
  147.     /**
  148.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
  149.      * @ORM\JoinColumn(nullable=true)
  150.      */
  151.     private $categoriePrestahop;
  152.     /**
  153.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"},inversedBy="categoriesEnfant")
  154.      * @ORM\JoinColumn(nullable=true)
  155.      */
  156.     private $categorieParent;
  157.     /**
  158.     * @ORM\OneToMany(targetEntity="App\Entity\Articles\Categorie", mappedBy="categorieParent")
  159.      * @ORM\OrderBy({"position" = "ASC"})
  160.     */
  161.     private $categoriesEnfant;
  162.     
  163.     /**
  164.      * @ORM\Column(name="position", type="integer", nullable=true)
  165.      */
  166.     private $position;
  167.     /**
  168.      * @ORM\Column(type="boolean", nullable=true)
  169.      */
  170.     private $additive;
  171.     public function __construct()
  172.                          {
  173.                              $this->date                   = new Datetime();
  174.                              $this->categoriesEnfant       = new ArrayCollection();
  175.                              $this->articleCategorie       = new ArrayCollection();
  176.                              $this->remiseCategorieArticle = new ArrayCollection();
  177.                              
  178.                          }
  179.     public function getId(): ?int
  180.     {
  181.         return $this->id;
  182.     }
  183.     public function setLibelle(string $libelle): Categorie
  184.     {
  185.         $this->libelle $libelle;
  186.         return $this;
  187.     }
  188.     public function getLibelle(): string
  189.     {
  190.         return ucfirst(strtolower($this->libelle));
  191.     }
  192.     public function setDate(?DateTime $date): Categorie
  193.     {
  194.         $this->date $date;
  195.         return $this;
  196.     }
  197.     public function getDate(): ?DateTime
  198.     {
  199.         return $this->date;
  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 setDateSuppression(?DateTime $dateSuppression): Categorie
  211.     {
  212.         $this->dateSuppression $dateSuppression;
  213.         return $this;
  214.     }
  215.     public function getDateSuppression(): ?DateTime
  216.     {
  217.         return $this->dateSuppression;
  218.     }
  219.     public function setDateMaj(?DateTime $dateMaj): Categorie
  220.     {
  221.         $this->dateMaj $dateMaj;
  222.         return $this;
  223.     }
  224.     public function getDateMaj(): ?DateTime
  225.     {
  226.         return $this->dateMaj;
  227.     }
  228.     public function setStatut(?bool $statut): Categorie
  229.     {
  230.         $this->statut $statut;
  231.         return $this;
  232.     }
  233.     public function getStatut(): ?bool
  234.     {
  235.         return $this->statut;
  236.     }
  237.     public function setLogo(?string $logo): Categorie
  238.     {
  239.         $this->logo $logo;
  240.         return $this;
  241.     }
  242.     public function getLogo(): ?string
  243.     {
  244.         return $this->logo;
  245.     }
  246.     
  247.     public function getLogoDir(): string
  248.     {
  249.         return 'uploads/logos/categorie';
  250.     }
  251.     
  252.     public function getLogo2Dir(): string
  253.     {
  254.         return 'uploads/logos/categorielogo';
  255.     }
  256.     public function setUtilisateur(?Utilisateur $utilisateur): Categorie
  257.     {
  258.         $this->utilisateur $utilisateur;
  259.         return $this;
  260.     }
  261.     public function getUtilisateur(): ?Utilisateur
  262.     {
  263.         return $this->utilisateur;
  264.     }
  265.     public function addArticleCategorie(ArticleCategorie $articleCategorie): Categorie
  266.     {
  267.         $this->articleCategorie[] = $articleCategorie;
  268.         return $this;
  269.     }
  270.     public function removeArticleCategorie(ArticleCategorie $articleCategorie)
  271.     {
  272.         $this->articleCategorie->removeElement($articleCategorie);
  273.     }
  274.     public function getArticleCategorie(): Collection
  275.     {
  276.         return $this->articleCategorie;
  277.     }
  278.     
  279.     public function __toString() 
  280.     {
  281.         return $this->libelle;
  282.     }
  283.     public function setIdImport(?int $idImport): Categorie
  284.     {
  285.         $this->idImport $idImport;
  286.         return $this;
  287.     }
  288.     public function getIdImport(): ?int
  289.     {
  290.         return $this->idImport;
  291.     }
  292.     public function addRemiseCategorieArticle(RemiseCategorieArticle $remiseCategorieArticle): Categorie
  293.     {
  294.         $this->remiseCategorieArticle[] = $remiseCategorieArticle;
  295.         return $this;
  296.     }
  297.     public function removeRemiseCategorieArticle(RemiseCategorieArticle $remiseCategorieArticle)
  298.     {
  299.         $this->remiseCategorieArticle->removeElement($remiseCategorieArticle);
  300.     }
  301.     public function getRemiseCategorieArticle(): Collection
  302.     {
  303.         return $this->remiseCategorieArticle;
  304.     }
  305.     public function addCategoriesEnfant(Categorie $categoriesEnfant): Categorie
  306.     {
  307.         $this->categoriesEnfant[] = $categoriesEnfant;
  308.         return $this;
  309.     }
  310.     public function removeCategoriesEnfant(Categorie $categoriesEnfant)
  311.     {
  312.         $this->categoriesEnfant->removeElement($categoriesEnfant);
  313.     }
  314.     public function getCategoriesEnfant(): Collection
  315.     {
  316.         return $this->categoriesEnfant;
  317.     }
  318.     public function setReference(string $reference): Categorie
  319.     {
  320.         $this->reference $reference;
  321.         return $this;
  322.     }
  323.     public function getReference(): ?string
  324.     {
  325.         return $this->reference;
  326.     }
  327.     public function setLogo2(?string $logo2): Categorie
  328.     {
  329.         $this->logo2 $logo2;
  330.         return $this;
  331.     }
  332.     public function getLogo2(): ?string
  333.     {
  334.         return $this->logo2;
  335.     }
  336.     public function setHomePagePrestashop(?bool $homePagePrestashop): Categorie
  337.     {
  338.         $this->homePagePrestashop $homePagePrestashop;
  339.         return $this;
  340.     }
  341.     public function getHomePagePrestashop(): ?bool
  342.     {
  343.         return $this->homePagePrestashop;
  344.     }
  345.     public function setPosition(?int $position): Categorie
  346.     {
  347.         $this->position $position;
  348.         return $this;
  349.     }
  350.     public function getPosition(): ?int
  351.     {
  352.         return $this->position;
  353.     }
  354.     public function setMarketPlace(?MarketPlace $marketPlace): Categorie
  355.     {
  356.         $this->marketPlace $marketPlace;
  357.         return $this;
  358.     }
  359.     public function getMarketPlace(): ?MarketPlace
  360.     {
  361.         return $this->marketPlace;
  362.     }
  363.     public function setProfilAmazon(?Profil $profilAmazon): Categorie
  364.     {
  365.         $this->profilAmazon $profilAmazon;
  366.         return $this;
  367.     }
  368.     public function getProfilAmazon(): ?Profil
  369.     {
  370.         return $this->profilAmazon;
  371.     }
  372.     public function setCategorieAmazon(?Categorie $categorieAmazon): Categorie
  373.     {
  374.         $this->categorieAmazon $categorieAmazon;
  375.         return $this;
  376.     }
  377.     public function getCategorieAmazon(): ?Categorie
  378.     {
  379.         return $this->categorieAmazon;
  380.     }
  381.     public function setCategorieCdiscount(?Categorie $categorieCdiscount): Categorie
  382.     {
  383.         $this->categorieCdiscount $categorieCdiscount;
  384.         return $this;
  385.     }
  386.     public function getCategorieCdiscount(): ?Categorie
  387.     {
  388.         return $this->categorieCdiscount;
  389.     }
  390.     public function setCategoriePriceMinister(?Categorie $categoriePriceMinister): Categorie
  391.     {
  392.         $this->categoriePriceMinister $categoriePriceMinister;
  393.         return $this;
  394.     }
  395.     public function getCategoriePriceMinister(): ?Categorie
  396.     {
  397.         return $this->categoriePriceMinister;
  398.     }
  399.     public function setCategorieEbay(?Categorie $categorieEbay): Categorie
  400.     {
  401.         $this->categorieEbay $categorieEbay;
  402.         return $this;
  403.     }
  404.     public function getCategorieEbay(): ?Categorie
  405.     {
  406.         return $this->categorieEbay;
  407.     }
  408.     public function setCategorieWordpress(?Categorie $categorieWordpress): Categorie
  409.     {
  410.         $this->categorieWordpress $categorieWordpress;
  411.         return $this;
  412.     }
  413.     public function getCategorieWordpress(): ?Categorie
  414.     {
  415.         return $this->categorieWordpress;
  416.     }
  417.     public function setCategorieWordpressWoo(?Categorie $categorieWordpressWoo): Categorie
  418.     {
  419.         $this->categorieWordpressWoo $categorieWordpressWoo;
  420.         return $this;
  421.     }
  422.     public function getCategorieWordpressWoo(): ?Categorie
  423.     {
  424.         return $this->categorieWordpressWoo;
  425.     }
  426.     public function setCategoriePrestahop(?Categorie $categoriePrestahop): Categorie
  427.     {
  428.         $this->categoriePrestahop $categoriePrestahop;
  429.         return $this;
  430.     }
  431.     public function getCategoriePrestahop(): ?Categorie
  432.     {
  433.         return $this->categoriePrestahop;
  434.     }
  435.     public function getIdPrestahop(): ?string
  436.     {
  437.         return $this->idPrestahop;
  438.     }
  439.     public function setIdPrestahop(?string $idPrestahop): self
  440.     {
  441.         $this->idPrestahop $idPrestahop;
  442.         return $this;
  443.     }
  444.     public function isStatut(): ?bool
  445.     {
  446.         return $this->statut;
  447.     }
  448.     public function isHomePagePrestashop(): ?bool
  449.     {
  450.         return $this->homePagePrestashop;
  451.     }
  452.     public function isAdditive(): ?bool
  453.     {
  454.         return $this->additive;
  455.     }
  456.     public function setAdditive(?bool $additive): self
  457.     {
  458.         $this->additive $additive;
  459.         return $this;
  460.     }
  461. }