src/Entity/Coleur.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ColeurRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassColeurRepository::class)]
  8. class Coleur
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255nullabletrue)]
  15.     private ?string $nom null;
  16.     #[ORM\OneToMany(targetEntityProduits::class, mappedBy'coleurs')]
  17.     private Collection $produits;
  18.     #[ORM\Column(nullabletrue)]
  19.     private ?bool $IsArchive false;
  20.     #[ORM\OneToMany(targetEntityDetailsproduit::class, mappedBy'couleur')]
  21.     private Collection $detailsproduits;
  22.     #[ORM\OneToMany(targetEntityArticleachat::class, mappedBy'couleurs')]
  23.     private Collection $articleachats;
  24.     #[ORM\OneToMany(targetEntityArticlebonsortie::class, mappedBy'couleurs')]
  25.     private Collection $articlebonsorties;
  26.     #[ORM\OneToMany(targetEntityArticlegestion::class, mappedBy'couleurs')]
  27.     private Collection $articlegestions;
  28.     public function __construct()
  29.     {
  30.         $this->produits = new ArrayCollection();
  31.         $this->detailsproduits = new ArrayCollection();
  32.         $this->articleachats = new ArrayCollection();
  33.         $this->articlebonsorties = new ArrayCollection();
  34.         $this->articlegestions = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getNom(): ?string
  41.     {
  42.         return $this->nom;
  43.     }
  44.     public function setNom(?string $nom): static
  45.     {
  46.         $this->nom $nom;
  47.         return $this;
  48.     }
  49.     /**
  50.      * @return Collection<int, Produits>
  51.      */
  52.     public function getProduits(): Collection
  53.     {
  54.         return $this->produits;
  55.     }
  56.     public function addProduit(Produits $produit): static
  57.     {
  58.         if (!$this->produits->contains($produit)) {
  59.             $this->produits->add($produit);
  60.             $produit->setColeurs($this);
  61.         }
  62.         return $this;
  63.     }
  64.     public function removeProduit(Produits $produit): static
  65.     {
  66.         if ($this->produits->removeElement($produit)) {
  67.             // set the owning side to null (unless already changed)
  68.             if ($produit->getColeurs() === $this) {
  69.                 $produit->setColeurs(null);
  70.             }
  71.         }
  72.         return $this;
  73.     }
  74.     public function isIsArchive(): ?bool
  75.     {
  76.         return $this->IsArchive;
  77.     }
  78.     public function setIsArchive(?bool $IsArchive): static
  79.     {
  80.         $this->IsArchive $IsArchive;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, Detailsproduit>
  85.      */
  86.     public function getDetailsproduits(): Collection
  87.     {
  88.         return $this->detailsproduits;
  89.     }
  90.     public function addDetailsproduit(Detailsproduit $detailsproduit): static
  91.     {
  92.         if (!$this->detailsproduits->contains($detailsproduit)) {
  93.             $this->detailsproduits->add($detailsproduit);
  94.             $detailsproduit->setCouleur($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeDetailsproduit(Detailsproduit $detailsproduit): static
  99.     {
  100.         if ($this->detailsproduits->removeElement($detailsproduit)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($detailsproduit->getCouleur() === $this) {
  103.                 $detailsproduit->setCouleur(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection<int, Articleachat>
  110.      */
  111.     public function getArticleachats(): Collection
  112.     {
  113.         return $this->articleachats;
  114.     }
  115.     public function addArticleachat(Articleachat $articleachat): static
  116.     {
  117.         if (!$this->articleachats->contains($articleachat)) {
  118.             $this->articleachats->add($articleachat);
  119.             $articleachat->setCouleurs($this);
  120.         }
  121.         return $this;
  122.     }
  123.     public function removeArticleachat(Articleachat $articleachat): static
  124.     {
  125.         if ($this->articleachats->removeElement($articleachat)) {
  126.             // set the owning side to null (unless already changed)
  127.             if ($articleachat->getCouleurs() === $this) {
  128.                 $articleachat->setCouleurs(null);
  129.             }
  130.         }
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection<int, Articlebonsortie>
  135.      */
  136.     public function getArticlebonsorties(): Collection
  137.     {
  138.         return $this->articlebonsorties;
  139.     }
  140.     public function addArticlebonsorty(Articlebonsortie $articlebonsorty): static
  141.     {
  142.         if (!$this->articlebonsorties->contains($articlebonsorty)) {
  143.             $this->articlebonsorties->add($articlebonsorty);
  144.             $articlebonsorty->setCouleurs($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeArticlebonsorty(Articlebonsortie $articlebonsorty): static
  149.     {
  150.         if ($this->articlebonsorties->removeElement($articlebonsorty)) {
  151.             // set the owning side to null (unless already changed)
  152.             if ($articlebonsorty->getCouleurs() === $this) {
  153.                 $articlebonsorty->setCouleurs(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection<int, Articlegestion>
  160.      */
  161.     public function getArticlegestions(): Collection
  162.     {
  163.         return $this->articlegestions;
  164.     }
  165.     public function addArticlegestion(Articlegestion $articlegestion): static
  166.     {
  167.         if (!$this->articlegestions->contains($articlegestion)) {
  168.             $this->articlegestions->add($articlegestion);
  169.             $articlegestion->setCouleurs($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeArticlegestion(Articlegestion $articlegestion): static
  174.     {
  175.         if ($this->articlegestions->removeElement($articlegestion)) {
  176.             // set the owning side to null (unless already changed)
  177.             if ($articlegestion->getCouleurs() === $this) {
  178.                 $articlegestion->setCouleurs(null);
  179.             }
  180.         }
  181.         return $this;
  182.     }
  183. }