<?php
namespace App\Entity\Articles;
use App\Entity\MarketPlace\MarketPlace;
use App\Entity\MarketPlace\Profil;
use App\Entity\Remises\RemiseCategorieArticle;
use App\Entity\Utilisateur\Utilisateur;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use App\Annotations\SecuredEntity;
/**
* Categorie
*
* @ORM\Table("article__categorie")
* @ORM\Entity(repositoryClass="App\Repository\Articles\CategorieRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity(name="Catégories", group="ARTICLES")
*/
class Categorie
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\MarketPlace\MarketPlace")
* @ORM\JoinColumn(nullable=true)
*/
private $marketPlace;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\MarketPlace\Profil")
*/
private $profilAmazon;
/**
* @ORM\Column(name="reference", type="string", length=255)
* @Assert\NotBlank(message="Référence obligatoire")
*/
private $reference;
/**
* @ORM\Column(name="id_import", type="string",length=255, nullable=true)
*/
private $idImport;
/**
* @var integer
*
* @ORM\Column(name="id_prestahop", type="string",length=255, nullable=true)
*/
private $idPrestahop;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Remises\RemiseCategorieArticle", mappedBy="categorie")
*/
private $remiseCategorieArticle;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Articles\ArticleCategorie", mappedBy="categorie")
*/
private $articleCategorie;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="categories")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="logo", type="string", length=255, nullable=true)
*/
private $logo;
/**
* @ORM\Column(name="logo2", type="string", length=255, nullable=true)
*/
private $logo2;
/**
* @ORM\Column(name="libelle", type="string", length=255)
* @Assert\NotBlank(message="Libellé obligatoire")
*/
private $libelle;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="date_supression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="date_maj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="statut", type="boolean", nullable=true)
*/
private $statut;
/**
* @ORM\Column(name="home_page_prestashop", type="boolean", nullable=true)
*/
private $homePagePrestashop;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $categorieAmazon;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $categorieCdiscount;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $categoriePriceMinister;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $categorieEbay;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $categorieWordpress;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $categorieWordpressWoo;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $categoriePrestahop;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Categorie", cascade={"persist"},inversedBy="categoriesEnfant")
* @ORM\JoinColumn(nullable=true)
*/
private $categorieParent;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Articles\Categorie", mappedBy="categorieParent")
* @ORM\OrderBy({"position" = "ASC"})
*/
private $categoriesEnfant;
/**
* @ORM\Column(name="position", type="integer", nullable=true)
*/
private $position;
public function __construct()
{
$this->date = new Datetime();
$this->categoriesEnfant = new ArrayCollection();
$this->articleCategorie = new ArrayCollection();
$this->remiseCategorieArticle = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function setLibelle(string $libelle): Categorie
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): string
{
return $this->libelle;
}
public function setDate(?DateTime $date): Categorie
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setCategorieParent(?Categorie $categorieParent): Categorie
{
$this->categorieParent = $categorieParent;
return $this;
}
public function getCategorieParent(): ?Categorie
{
return $this->categorieParent;
}
public function setDateSuppression(?DateTime $dateSuppression): Categorie
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): Categorie
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setStatut(?bool $statut): Categorie
{
$this->statut = $statut;
return $this;
}
public function getStatut(): ?bool
{
return $this->statut;
}
public function setLogo(?string $logo): Categorie
{
$this->logo = $logo;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function getLogoDir(): string
{
return 'uploads/logos/categorie';
}
public function getLogo2Dir(): string
{
return 'uploads/logos/categorielogo';
}
public function setUtilisateur(?Utilisateur $utilisateur): Categorie
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addArticleCategorie(ArticleCategorie $articleCategorie): Categorie
{
$this->articleCategorie[] = $articleCategorie;
return $this;
}
public function removeArticleCategorie(ArticleCategorie $articleCategorie)
{
$this->articleCategorie->removeElement($articleCategorie);
}
public function getArticleCategorie(): Collection
{
return $this->articleCategorie;
}
public function __toString()
{
return $this->libelle;
}
public function setIdImport(?int $idImport): Categorie
{
$this->idImport = $idImport;
return $this;
}
public function getIdImport(): ?int
{
return $this->idImport;
}
public function addRemiseCategorieArticle(RemiseCategorieArticle $remiseCategorieArticle): Categorie
{
$this->remiseCategorieArticle[] = $remiseCategorieArticle;
return $this;
}
public function removeRemiseCategorieArticle(RemiseCategorieArticle $remiseCategorieArticle)
{
$this->remiseCategorieArticle->removeElement($remiseCategorieArticle);
}
public function getRemiseCategorieArticle(): Collection
{
return $this->remiseCategorieArticle;
}
public function addCategoriesEnfant(Categorie $categoriesEnfant): Categorie
{
$this->categoriesEnfant[] = $categoriesEnfant;
return $this;
}
public function removeCategoriesEnfant(Categorie $categoriesEnfant)
{
$this->categoriesEnfant->removeElement($categoriesEnfant);
}
public function getCategoriesEnfant(): Collection
{
return $this->categoriesEnfant;
}
public function setReference(string $reference): Categorie
{
$this->reference = $reference;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setLogo2(?string $logo2): Categorie
{
$this->logo2 = $logo2;
return $this;
}
public function getLogo2(): ?string
{
return $this->logo2;
}
public function setHomePagePrestashop(?bool $homePagePrestashop): Categorie
{
$this->homePagePrestashop = $homePagePrestashop;
return $this;
}
public function getHomePagePrestashop(): ?bool
{
return $this->homePagePrestashop;
}
public function setPosition(?int $position): Categorie
{
$this->position = $position;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setMarketPlace(?MarketPlace $marketPlace): Categorie
{
$this->marketPlace = $marketPlace;
return $this;
}
public function getMarketPlace(): ?MarketPlace
{
return $this->marketPlace;
}
public function setProfilAmazon(?Profil $profilAmazon): Categorie
{
$this->profilAmazon = $profilAmazon;
return $this;
}
public function getProfilAmazon(): ?Profil
{
return $this->profilAmazon;
}
public function setCategorieAmazon(?Categorie $categorieAmazon): Categorie
{
$this->categorieAmazon = $categorieAmazon;
return $this;
}
public function getCategorieAmazon(): ?Categorie
{
return $this->categorieAmazon;
}
public function setCategorieCdiscount(?Categorie $categorieCdiscount): Categorie
{
$this->categorieCdiscount = $categorieCdiscount;
return $this;
}
public function getCategorieCdiscount(): ?Categorie
{
return $this->categorieCdiscount;
}
public function setCategoriePriceMinister(?Categorie $categoriePriceMinister): Categorie
{
$this->categoriePriceMinister = $categoriePriceMinister;
return $this;
}
public function getCategoriePriceMinister(): ?Categorie
{
return $this->categoriePriceMinister;
}
public function setCategorieEbay(?Categorie $categorieEbay): Categorie
{
$this->categorieEbay = $categorieEbay;
return $this;
}
public function getCategorieEbay(): ?Categorie
{
return $this->categorieEbay;
}
public function setCategorieWordpress(?Categorie $categorieWordpress): Categorie
{
$this->categorieWordpress = $categorieWordpress;
return $this;
}
public function getCategorieWordpress(): ?Categorie
{
return $this->categorieWordpress;
}
public function setCategorieWordpressWoo(?Categorie $categorieWordpressWoo): Categorie
{
$this->categorieWordpressWoo = $categorieWordpressWoo;
return $this;
}
public function getCategorieWordpressWoo(): ?Categorie
{
return $this->categorieWordpressWoo;
}
public function setCategoriePrestahop(?Categorie $categoriePrestahop): Categorie
{
$this->categoriePrestahop = $categoriePrestahop;
return $this;
}
public function getCategoriePrestahop(): ?Categorie
{
return $this->categoriePrestahop;
}
public function getIdPrestahop(): ?string
{
return $this->idPrestahop;
}
public function setIdPrestahop(?string $idPrestahop): self
{
$this->idPrestahop = $idPrestahop;
return $this;
}
public function isStatut(): ?bool
{
return $this->statut;
}
public function isHomePagePrestashop(): ?bool
{
return $this->homePagePrestashop;
}
}