src/Entity/Marque.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MarqueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassMarqueRepository::class)]
  8. class Marque
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $code null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $marque_libelle null;
  18.     #[ORM\OneToMany(mappedBy'marque'targetEntityArticle::class)]
  19.     private Collection $articles;
  20.     #[ORM\OneToMany(mappedBy'marque'targetEntityProduit::class)]
  21.     private Collection $produits;
  22.     #[ORM\OneToMany(mappedBy'marque'targetEntityStatistiques::class)]
  23.     private Collection $statistiques;
  24.     public function __construct()
  25.     {
  26.         $this->articles = new ArrayCollection();
  27.         $this->produits = new ArrayCollection();
  28.         $this->statistiques = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getMarqueCode(): ?string
  35.     {
  36.         return $this->code;
  37.     }
  38.     public function setMarqueCode(string $code): self
  39.     {
  40.         $this->code $code;
  41.         return $this;
  42.     }
  43.     public function getMarqueLibelle(): ?string
  44.     {
  45.         return $this->marque_libelle;
  46.     }
  47.     public function setMarqueLibelle(string $marque_libelle): self
  48.     {
  49.         $this->marque_libelle $marque_libelle;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection<int, Article>
  54.      */
  55.     public function getArticles(): Collection
  56.     {
  57.         return $this->articles;
  58.     }
  59.     public function addArticle(Article $article): self
  60.     {
  61.         if (!$this->articles->contains($article)) {
  62.             $this->articles->add($article);
  63.             $article->setToto($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeArticle(Article $article): self
  68.     {
  69.         if ($this->articles->removeElement($article)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($article->getToto() === $this) {
  72.                 $article->setToto(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     /**
  78.      * @return Collection<int, Produit>
  79.      */
  80.     public function getProduits(): Collection
  81.     {
  82.         return $this->produits;
  83.     }
  84.     public function addProduit(Produit $produit): self
  85.     {
  86.         if (!$this->produits->contains($produit)) {
  87.             $this->produits->add($produit);
  88.             $produit->setMarque($this);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeProduit(Produit $produit): self
  93.     {
  94.         if ($this->produits->removeElement($produit)) {
  95.             // set the owning side to null (unless already changed)
  96.             if ($produit->getMarque() === $this) {
  97.                 $produit->setMarque(null);
  98.             }
  99.         }
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection<int, Statistiques>
  104.      */
  105.     public function getStatistiques(): Collection
  106.     {
  107.         return $this->statistiques;
  108.     }
  109.     public function addStatistique(Statistiques $statistique): self
  110.     {
  111.         if (!$this->statistiques->contains($statistique)) {
  112.             $this->statistiques->add($statistique);
  113.             $statistique->setMarque($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removeStatistique(Statistiques $statistique): self
  118.     {
  119.         if ($this->statistiques->removeElement($statistique)) {
  120.             // set the owning side to null (unless already changed)
  121.             if ($statistique->getMarque() === $this) {
  122.                 $statistique->setMarque(null);
  123.             }
  124.         }
  125.         return $this;
  126.     }
  127. }