<?php
namespace App\Entity\Clients;
use App\Entity\Articles\Compta;
use App\Entity\Articles\PrixPromo;
use App\Entity\Remises\RemiseCategorieClient;
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("client__categorie")
* @ORM\Entity(repositoryClass="App\Repository\Clients\CategorieRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity(name="Categorie", group="CLIENTS")
*/
class Categorie
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Articles\PrixPromo", mappedBy="categorieClient")
*/
private $prixPromo;
/**
* @ORM\Column(name="professionnel", type="boolean", nullable=true)
*/
private $professionnel;
/**
* @ORM\Column(name="modifiable", type="boolean", nullable=true)
*/
private $modifiable;
/**
* @ORM\Column(name="idImport", type="string", length=255, nullable=true)
*/
private $idImport;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Clients\Categorie", cascade={"persist"}, inversedBy="categoriesEnfant" )
* @ORM\JoinColumn(nullable=true)
*/
private $categorieParent;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Clients\Categorie", mappedBy="categorieParent")
* @ORM\OrderBy({"libelle" = "ASC"})
*/
private $categoriesEnfant;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Remises\RemiseCategorieClient", mappedBy="categorie")
*/
private $remiseCategorieClient;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Clients\ClientCategorie", mappedBy="categorie")
*/
private $clientCategorie;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="clientCategorie")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="libelle", type="string", length=255, nullable=true)
* @Assert\NotBlank(message="Libellé obligatoire")
*/
private $libelle;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Compta", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $compta;
/**
* @var integer
*
* @ORM\Column(name="id_prestashop", type="string",length=255, nullable=true)
*/
private $idPrestashop;
public function __construct()
{
$this->date = new Datetime();
$this->modifiable = true;
$this->categoriesEnfant = new ArrayCollection();
$this->prixPromo = new ArrayCollection();
$this->remiseCategorieClient = new ArrayCollection();
$this->clientCategorie = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setDate(?Datetime $date): Categorie
{
$this->date = $date;
return $this;
}
public function getDate(): ?Datetime
{
return $this->date;
}
public function setLibelle(?string $libelle): Categorie
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDateMaj(?Datetime $dateMaj): Categorie
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?Datetime
{
return $this->dateMaj;
}
public function setDateSuppression(?Datetime $dateSuppression): Categorie
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?Datetime
{
return $this->dateSuppression;
}
public function __toString() {
return $this->libelle;
}
public function setUtilisateur(?Utilisateur $utilisateur = null): Categorie
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addClientCategorie(ClientCategorie $clientCategorie): Categorie
{
$this->clientCategorie[] = $clientCategorie;
return $this;
}
public function removeClientCategorie(ClientCategorie $clientCategorie)
{
$this->clientCategorie->removeElement($clientCategorie);
}
public function getClientCategorie(): Collection
{
return $this->clientCategorie;
}
public function addRemiseCategorieClient(RemiseCategorieClient $remiseCategorieClient): Categorie
{
$this->remiseCategorieClient[] = $remiseCategorieClient;
return $this;
}
public function removeRemiseCategorieClient(RemiseCategorieClient $remiseCategorieClient)
{
$this->remiseCategorieClient->removeElement($remiseCategorieClient);
}
public function getRemiseCategorieClient(): Collection
{
return $this->remiseCategorieClient;
}
public function setIdImport(?string $idImport): Categorie
{
$this->idImport = $idImport;
return $this;
}
public function getIdImport(): ?string
{
return $this->idImport;
}
public function setCategorieParent(?Categorie $categorieParent): Categorie
{
$this->categorieParent = $categorieParent;
return $this;
}
public function getCategorieParent(): ?Categorie
{
return $this->categorieParent;
}
public function addPrixPromo(PrixPromo $prixPromo): Categorie
{
$this->prixPromo[] = $prixPromo;
return $this;
}
public function removePrixPromo(PrixPromo $prixPromo)
{
$this->prixPromo->removeElement($prixPromo);
}
public function getPrixPromo(): Collection
{
return $this->prixPromo;
}
public function setModifiable(?bool $modifiable): Categorie
{
$this->modifiable = $modifiable;
return $this;
}
public function getModifiable(): ?bool
{
return $this->modifiable;
}
public function setProfessionnel(?bool $professionnel): Categorie
{
$this->professionnel = $professionnel;
return $this;
}
public function getProfessionnel(): ?bool
{
return $this->professionnel;
}
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 setCompta(?Compta $compta): Categorie
{
$this->compta = $compta;
return $this;
}
public function getCompta(): ?Compta
{
return $this->compta;
}
public function isProfessionnel(): ?bool
{
return $this->professionnel;
}
public function isModifiable(): ?bool
{
return $this->modifiable;
}
public function getIdPrestashop(): ?string
{
return $this->idPrestashop;
}
public function setIdPrestashop(?string $idPrestashop): self
{
$this->idPrestashop = $idPrestashop;
return $this;
}
}