src/Entity/Articles/Marque.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use App\Entity\Remises\RemiseMarqueArticle;
  4. use App\Entity\Utilisateur\Utilisateur;
  5. use Datetime;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use App\Annotations\SecuredEntity;
  12. /**
  13.  * Marque
  14.  *
  15.  * @ORM\Table("article__marque")
  16.  * @ORM\Entity(repositoryClass="App\Repository\Articles\MarqueRepository")
  17.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  18.  * @SecuredEntity(name="Marque", group="ARTICLES")
  19.  */
  20. class Marque
  21. {
  22.     /**
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     
  29.     /**
  30.      * @ORM\Column(name="reference", type="string", length=255)
  31.      * @Assert\NotBlank(message="Référence obligatoire")      
  32.      */
  33.     private $reference;
  34.     
  35.     /**
  36.      * @ORM\OneToMany(targetEntity="App\Entity\Remises\RemiseMarqueArticle", mappedBy="marque")
  37.      */
  38.     private $remiseMarqueArticle;    
  39.     
  40.     /**
  41.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  42.      */
  43.     private $idImport;    
  44.     /**
  45.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="marqueArticle")
  46.      * @ORM\JoinColumn(nullable=true)
  47.      */
  48.     private $utilisateur;
  49.     /**
  50.      * @ORM\Column(name="logo", type="string", length=255, nullable=true)
  51.      */
  52.     private $logo;
  53.     /**
  54.      * @ORM\Column(name="libelle", type="string", length=255)
  55.      * @ORM\Column(name="libelle", type="string", length=255)
  56.      * @Assert\NotBlank(message="Libellé obligatoire")     
  57.      */
  58.     private $libelle;
  59.     /**
  60.      * @ORM\Column(name="date", type="datetime")
  61.      */
  62.     private $date;
  63.     
  64.     /**
  65.      * @ORM\Column(name="description", type="text", nullable=true)
  66.     */
  67.     private $description;
  68.     
  69.     /**
  70.      * @ORM\Column(name="description_courte", type="text", nullable=true)
  71.     */
  72.     private $descriptionCourte;
  73.     
  74.     /**
  75.      * @ORM\Column(name="date_supression", type="datetime", nullable=true)
  76.      */
  77.     private $dateSuppression;
  78.     /**
  79.      * @ORM\Column(name="date_maj", type="datetime", nullable=true)
  80.      * @Gedmo\Timestampable(on="update")
  81.      */
  82.     private $dateMaj;
  83.     /**
  84.      * @ORM\Column(name="statut", type="boolean", nullable=true)
  85.      */
  86.     private $statut;
  87.     
  88.      /**
  89.      * @ORM\Column(name="position", type="integer", nullable=true)
  90.      */
  91.     private $position;
  92.     /**
  93.      * @ORM\Column(type="string", length=255, nullable=true)
  94.      */
  95.     private $logoNb;
  96.     /**
  97.      * @ORM\Column(type="boolean", nullable=true)
  98.      */
  99.     private $visibleAccueilEpObi;
  100.     /**
  101.      * @ORM\Column(type="boolean", nullable=true, options={"default":false})
  102.      */
  103.     private $statutApi;
  104.     
  105.     public function __construct()
  106.                                {
  107.                                    $this->date                = new Datetime();
  108.                                    $this->notifications        = new ArrayCollection();
  109.                                    $this->remiseMarqueArticle = new ArrayCollection();
  110.                                }
  111.     public function getId(): int
  112.     {
  113.         return $this->id;
  114.     }
  115.     public function setLibelle(string $libelle): Marque
  116.     {
  117.         $this->libelle $libelle;
  118.         return $this;
  119.     }
  120.     public function getLibelle(): string
  121.     {
  122.         return $this->libelle;
  123.     }
  124.     public function setDate(Datetime $date): Marque
  125.     {
  126.         $this->date $date;
  127.         return $this;
  128.     }
  129.     public function getDate(): Datetime
  130.     {
  131.         return $this->date;
  132.     }
  133.     public function setDescription(?string $description): Marque
  134.     {
  135.         $this->description $description;
  136.         return $this;
  137.     }
  138.     public function getDescription(): ?string
  139.     {
  140.         return $this->description;
  141.     }
  142.     public function setDescriptionCourte(?string $descriptionCourte): Marque
  143.     {
  144.         $this->descriptionCourte $descriptionCourte;
  145.         return $this;
  146.     }
  147.     public function getDescriptionCourte(): ?string
  148.     {
  149.         return $this->descriptionCourte;
  150.     }
  151.     public function setPosition(?int $position): Marque
  152.     {
  153.         $this->position $position;
  154.         return $this;
  155.     }
  156.     public function getPosition(): ?int
  157.     {
  158.         return $this->position;
  159.     }
  160.     
  161.     public function __toString() {
  162.         return $this->libelle;
  163.     }
  164.     public function setDateSuppression(?Datetime $dateSuppression): Marque
  165.     {
  166.         $this->dateSuppression $dateSuppression;
  167.         return $this;
  168.     }
  169.     public function getDateSuppression(): ?Datetime
  170.     {
  171.         return $this->dateSuppression;
  172.     }
  173.     public function setDateMaj(?Datetime $dateMaj): Marque
  174.     {
  175.         $this->dateMaj $dateMaj;
  176.         return $this;
  177.     }
  178.     public function getDateMaj(): ?Datetime
  179.     {
  180.         return $this->dateMaj;
  181.     }
  182.     public function setStatut(?bool $statut): Marque
  183.     {
  184.         $this->statut $statut;
  185.         return $this;
  186.     }
  187.     public function getStatut(): ?bool
  188.     {
  189.         return $this->statut;
  190.     }
  191.     public function setLogo(?string $logo): Marque
  192.     {
  193.         $this->logo $logo;
  194.         return $this;
  195.     }
  196.     public function getLogo(): ?string
  197.     {
  198.         return $this->logo;
  199.     }
  200.     
  201.     public function getLogoDir(): string
  202.     {
  203.         return 'uploads/logos/marques';
  204.     }
  205.     public function setUtilisateur(?Utilisateur $utilisateur): Marque
  206.     {
  207.         $this->utilisateur $utilisateur;
  208.         return $this;
  209.     }
  210.     public function getUtilisateur(): ?Utilisateur
  211.     {
  212.         return $this->utilisateur;
  213.     }
  214.     public function setIdImport(?string $idImport): Marque
  215.     {
  216.         $this->idImport $idImport;
  217.         return $this;
  218.     }
  219.     public function getIdImport(): ?string
  220.     {
  221.         return $this->idImport;
  222.     }
  223.     public function addRemiseMarqueArticle(RemiseMarqueArticle $remiseMarqueArticle): Marque
  224.     {
  225.         $this->remiseMarqueArticle[] = $remiseMarqueArticle;
  226.         return $this;
  227.     }
  228.     public function removeRemiseMarqueArticle(RemiseMarqueArticle $remiseMarqueArticle)
  229.     {
  230.         $this->remiseMarqueArticle->removeElement($remiseMarqueArticle);
  231.     }
  232.     public function getRemiseMarqueArticle(): Collection
  233.     {
  234.         return $this->remiseMarqueArticle;
  235.     }
  236.     public function setReference(string $reference): Marque
  237.     {
  238.         $this->reference $reference;
  239.         return $this;
  240.     }
  241.     public function getReference(): string
  242.     {
  243.         return $this->reference;
  244.     }
  245.     public function getLogoNb(): ?string
  246.     {
  247.         return $this->logoNb;
  248.     }
  249.     public function setLogoNb(?string $logoNb): self
  250.     {
  251.         $this->logoNb $logoNb;
  252.         return $this;
  253.     }
  254.     public function isVisibleAccueilEpObi(): ?bool
  255.     {
  256.         return $this->visibleAccueilEpObi;
  257.     }
  258.     public function setVisibleAccueilEpObi(?bool $visibleAccueilEpObi): self
  259.     {
  260.         $this->visibleAccueilEpObi $visibleAccueilEpObi;
  261.         return $this;
  262.     }
  263.     public function isStatutApi(): ?bool
  264.     {
  265.         return $this->statutApi;
  266.     }
  267.     public function setStatutApi(?bool $statutApi): self
  268.     {
  269.         $this->statutApi $statutApi;
  270.         return $this;
  271.     }
  272. }