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.     public function __construct()
  168.                 {
  169.                     $this->date                   = new Datetime();
  170.                     $this->categoriesEnfant       = new ArrayCollection();
  171.                     $this->articleCategorie       = new ArrayCollection();
  172.                     $this->remiseCategorieArticle = new ArrayCollection();
  173.                     
  174.                 }
  175.     public function getId(): ?int
  176.     {
  177.         return $this->id;
  178.     }
  179.     public function setLibelle(string $libelle): Categorie
  180.     {
  181.         $this->libelle $libelle;
  182.         return $this;
  183.     }
  184.     public function getLibelle(): string
  185.     {
  186.         return $this->libelle;
  187.     }
  188.     public function setDate(?DateTime $date): Categorie
  189.     {
  190.         $this->date $date;
  191.         return $this;
  192.     }
  193.     public function getDate(): ?DateTime
  194.     {
  195.         return $this->date;
  196.     }
  197.     public function setCategorieParent(?Categorie $categorieParent): Categorie
  198.     {
  199.         $this->categorieParent $categorieParent;
  200.         return $this;
  201.     }
  202.     public function getCategorieParent(): ?Categorie
  203.     {
  204.         return $this->categorieParent;
  205.     }
  206.     public function setDateSuppression(?DateTime $dateSuppression): Categorie
  207.     {
  208.         $this->dateSuppression $dateSuppression;
  209.         return $this;
  210.     }
  211.     public function getDateSuppression(): ?DateTime
  212.     {
  213.         return $this->dateSuppression;
  214.     }
  215.     public function setDateMaj(?DateTime $dateMaj): Categorie
  216.     {
  217.         $this->dateMaj $dateMaj;
  218.         return $this;
  219.     }
  220.     public function getDateMaj(): ?DateTime
  221.     {
  222.         return $this->dateMaj;
  223.     }
  224.     public function setStatut(?bool $statut): Categorie
  225.     {
  226.         $this->statut $statut;
  227.         return $this;
  228.     }
  229.     public function getStatut(): ?bool
  230.     {
  231.         return $this->statut;
  232.     }
  233.     public function setLogo(?string $logo): Categorie
  234.     {
  235.         $this->logo $logo;
  236.         return $this;
  237.     }
  238.     public function getLogo(): ?string
  239.     {
  240.         return $this->logo;
  241.     }
  242.     
  243.     public function getLogoDir(): string
  244.     {
  245.         return 'uploads/logos/categorie';
  246.     }
  247.     
  248.     public function getLogo2Dir(): string
  249.     {
  250.         return 'uploads/logos/categorielogo';
  251.     }
  252.     public function setUtilisateur(?Utilisateur $utilisateur): Categorie
  253.     {
  254.         $this->utilisateur $utilisateur;
  255.         return $this;
  256.     }
  257.     public function getUtilisateur(): ?Utilisateur
  258.     {
  259.         return $this->utilisateur;
  260.     }
  261.     public function addArticleCategorie(ArticleCategorie $articleCategorie): Categorie
  262.     {
  263.         $this->articleCategorie[] = $articleCategorie;
  264.         return $this;
  265.     }
  266.     public function removeArticleCategorie(ArticleCategorie $articleCategorie)
  267.     {
  268.         $this->articleCategorie->removeElement($articleCategorie);
  269.     }
  270.     public function getArticleCategorie(): Collection
  271.     {
  272.         return $this->articleCategorie;
  273.     }
  274.     
  275.     public function __toString() 
  276.     {
  277.         return $this->libelle;
  278.     }
  279.     public function setIdImport(?int $idImport): Categorie
  280.     {
  281.         $this->idImport $idImport;
  282.         return $this;
  283.     }
  284.     public function getIdImport(): ?int
  285.     {
  286.         return $this->idImport;
  287.     }
  288.     public function addRemiseCategorieArticle(RemiseCategorieArticle $remiseCategorieArticle): Categorie
  289.     {
  290.         $this->remiseCategorieArticle[] = $remiseCategorieArticle;
  291.         return $this;
  292.     }
  293.     public function removeRemiseCategorieArticle(RemiseCategorieArticle $remiseCategorieArticle)
  294.     {
  295.         $this->remiseCategorieArticle->removeElement($remiseCategorieArticle);
  296.     }
  297.     public function getRemiseCategorieArticle(): Collection
  298.     {
  299.         return $this->remiseCategorieArticle;
  300.     }
  301.     public function addCategoriesEnfant(Categorie $categoriesEnfant): Categorie
  302.     {
  303.         $this->categoriesEnfant[] = $categoriesEnfant;
  304.         return $this;
  305.     }
  306.     public function removeCategoriesEnfant(Categorie $categoriesEnfant)
  307.     {
  308.         $this->categoriesEnfant->removeElement($categoriesEnfant);
  309.     }
  310.     public function getCategoriesEnfant(): Collection
  311.     {
  312.         return $this->categoriesEnfant;
  313.     }
  314.     public function setReference(string $reference): Categorie
  315.     {
  316.         $this->reference $reference;
  317.         return $this;
  318.     }
  319.     public function getReference(): ?string
  320.     {
  321.         return $this->reference;
  322.     }
  323.     public function setLogo2(?string $logo2): Categorie
  324.     {
  325.         $this->logo2 $logo2;
  326.         return $this;
  327.     }
  328.     public function getLogo2(): ?string
  329.     {
  330.         return $this->logo2;
  331.     }
  332.     public function setHomePagePrestashop(?bool $homePagePrestashop): Categorie
  333.     {
  334.         $this->homePagePrestashop $homePagePrestashop;
  335.         return $this;
  336.     }
  337.     public function getHomePagePrestashop(): ?bool
  338.     {
  339.         return $this->homePagePrestashop;
  340.     }
  341.     public function setPosition(?int $position): Categorie
  342.     {
  343.         $this->position $position;
  344.         return $this;
  345.     }
  346.     public function getPosition(): ?int
  347.     {
  348.         return $this->position;
  349.     }
  350.     public function setMarketPlace(?MarketPlace $marketPlace): Categorie
  351.     {
  352.         $this->marketPlace $marketPlace;
  353.         return $this;
  354.     }
  355.     public function getMarketPlace(): ?MarketPlace
  356.     {
  357.         return $this->marketPlace;
  358.     }
  359.     public function setProfilAmazon(?Profil $profilAmazon): Categorie
  360.     {
  361.         $this->profilAmazon $profilAmazon;
  362.         return $this;
  363.     }
  364.     public function getProfilAmazon(): ?Profil
  365.     {
  366.         return $this->profilAmazon;
  367.     }
  368.     public function setCategorieAmazon(?Categorie $categorieAmazon): Categorie
  369.     {
  370.         $this->categorieAmazon $categorieAmazon;
  371.         return $this;
  372.     }
  373.     public function getCategorieAmazon(): ?Categorie
  374.     {
  375.         return $this->categorieAmazon;
  376.     }
  377.     public function setCategorieCdiscount(?Categorie $categorieCdiscount): Categorie
  378.     {
  379.         $this->categorieCdiscount $categorieCdiscount;
  380.         return $this;
  381.     }
  382.     public function getCategorieCdiscount(): ?Categorie
  383.     {
  384.         return $this->categorieCdiscount;
  385.     }
  386.     public function setCategoriePriceMinister(?Categorie $categoriePriceMinister): Categorie
  387.     {
  388.         $this->categoriePriceMinister $categoriePriceMinister;
  389.         return $this;
  390.     }
  391.     public function getCategoriePriceMinister(): ?Categorie
  392.     {
  393.         return $this->categoriePriceMinister;
  394.     }
  395.     public function setCategorieEbay(?Categorie $categorieEbay): Categorie
  396.     {
  397.         $this->categorieEbay $categorieEbay;
  398.         return $this;
  399.     }
  400.     public function getCategorieEbay(): ?Categorie
  401.     {
  402.         return $this->categorieEbay;
  403.     }
  404.     public function setCategorieWordpress(?Categorie $categorieWordpress): Categorie
  405.     {
  406.         $this->categorieWordpress $categorieWordpress;
  407.         return $this;
  408.     }
  409.     public function getCategorieWordpress(): ?Categorie
  410.     {
  411.         return $this->categorieWordpress;
  412.     }
  413.     public function setCategorieWordpressWoo(?Categorie $categorieWordpressWoo): Categorie
  414.     {
  415.         $this->categorieWordpressWoo $categorieWordpressWoo;
  416.         return $this;
  417.     }
  418.     public function getCategorieWordpressWoo(): ?Categorie
  419.     {
  420.         return $this->categorieWordpressWoo;
  421.     }
  422.     public function setCategoriePrestahop(?Categorie $categoriePrestahop): Categorie
  423.     {
  424.         $this->categoriePrestahop $categoriePrestahop;
  425.         return $this;
  426.     }
  427.     public function getCategoriePrestahop(): ?Categorie
  428.     {
  429.         return $this->categoriePrestahop;
  430.     }
  431.     public function getIdPrestahop(): ?string
  432.     {
  433.         return $this->idPrestahop;
  434.     }
  435.     public function setIdPrestahop(?string $idPrestahop): self
  436.     {
  437.         $this->idPrestahop $idPrestahop;
  438.         return $this;
  439.     }
  440.     public function isStatut(): ?bool
  441.     {
  442.         return $this->statut;
  443.     }
  444.     public function isHomePagePrestashop(): ?bool
  445.     {
  446.         return $this->homePagePrestashop;
  447.     }
  448. }