src/Entity/Boutique.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BoutiqueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassBoutiqueRepository::class)]
  8. class Boutique
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nom null;
  16.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'boutiques')]
  17.     private ?self $boutiqueMere null;
  18.     #[ORM\OneToMany(mappedBy'boutiqueMere'targetEntityself::class)]
  19.     private Collection $boutiques;
  20.     #[ORM\OneToMany(mappedBy'boutique'targetEntityProduitStock::class)]
  21.     private Collection $produitStock;
  22.     #[ORM\OneToMany(mappedBy'boutique'targetEntitySortieStock::class)]
  23.     private Collection $sortieStocks;
  24.     #[ORM\OneToMany(mappedBy'boutique'targetEntityVente::class)]
  25.     private Collection $ventes;
  26.     #[ORM\OneToMany(mappedBy'boutique'targetEntityEntreeStock::class)]
  27.     private Collection $entreeStocks;
  28.     #[ORM\Column(nullabletrue)]
  29.     private ?bool $isMere null;
  30.     #[ORM\OneToMany(mappedBy'boutique'targetEntityUser::class)]
  31.     private Collection $users;
  32.     #[ORM\OneToMany(mappedBy'boutique'targetEntityRecette::class)]
  33.     private Collection $recettes;
  34.     public function __construct()
  35.     {
  36.         $this->boutiques = new ArrayCollection();
  37.         $this->produitStock = new ArrayCollection();
  38.         $this->sortieStocks = new ArrayCollection();
  39.         $this->ventes = new ArrayCollection();
  40.         $this->entreeStocks = new ArrayCollection();
  41.         $this->users = new ArrayCollection();
  42.         $this->recettes = new ArrayCollection();
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getNom(): ?string
  49.     {
  50.         return $this->nom;
  51.     }
  52.     public function setNom(string $nom): static
  53.     {
  54.         $this->nom $nom;
  55.         return $this;
  56.     }
  57.     public function getBoutiqueMere(): ?self
  58.     {
  59.         return $this->boutiqueMere;
  60.     }
  61.     public function setBoutiqueMere(?self $boutiqueMere): static
  62.     {
  63.         $this->boutiqueMere $boutiqueMere;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, self>
  68.      */
  69.     public function getBoutiques(): Collection
  70.     {
  71.         return $this->boutiques;
  72.     }
  73.     public function addBoutique(self $boutique): static
  74.     {
  75.         if (!$this->boutiques->contains($boutique)) {
  76.             $this->boutiques->add($boutique);
  77.             $boutique->setBoutiqueMere($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeBoutique(self $boutique): static
  82.     {
  83.         if ($this->boutiques->removeElement($boutique)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($boutique->getBoutiqueMere() === $this) {
  86.                 $boutique->setBoutiqueMere(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, ProduitStock>
  93.      */
  94.     public function getProduitStock(): Collection
  95.     {
  96.         return $this->produitStock;
  97.     }
  98.     public function addProduitStock(ProduitStock $produitStock): static
  99.     {
  100.         if (!$this->produitStock->contains($produitStock)) {
  101.             $this->produitStock->add($produitStock);
  102.             $produitStock->setBoutique($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeProduitStock(ProduitStock $produitStock): static
  107.     {
  108.         if ($this->produitStock->removeElement($produitStock)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($produitStock->getBoutique() === $this) {
  111.                 $produitStock->setBoutique(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116.     /**
  117.      * @return Collection<int, SortieStock>
  118.      */
  119.     public function getSortieStocks(): Collection
  120.     {
  121.         return $this->sortieStocks;
  122.     }
  123.     public function addSortieStock(SortieStock $sortieStock): static
  124.     {
  125.         if (!$this->sortieStocks->contains($sortieStock)) {
  126.             $this->sortieStocks->add($sortieStock);
  127.             $sortieStock->setBoutique($this);
  128.         }
  129.         return $this;
  130.     }
  131.     public function removeSortieStock(SortieStock $sortieStock): static
  132.     {
  133.         if ($this->sortieStocks->removeElement($sortieStock)) {
  134.             // set the owning side to null (unless already changed)
  135.             if ($sortieStock->getBoutique() === $this) {
  136.                 $sortieStock->setBoutique(null);
  137.             }
  138.         }
  139.         return $this;
  140.     }
  141.     /**
  142.      * @return Collection<int, Vente>
  143.      */
  144.     public function getVentes(): Collection
  145.     {
  146.         return $this->ventes;
  147.     }
  148.     public function addVente(Vente $vente): static
  149.     {
  150.         if (!$this->ventes->contains($vente)) {
  151.             $this->ventes->add($vente);
  152.             $vente->setBoutique($this);
  153.         }
  154.         return $this;
  155.     }
  156.     public function removeVente(Vente $vente): static
  157.     {
  158.         if ($this->ventes->removeElement($vente)) {
  159.             // set the owning side to null (unless already changed)
  160.             if ($vente->getBoutique() === $this) {
  161.                 $vente->setBoutique(null);
  162.             }
  163.         }
  164.         return $this;
  165.     }
  166.     /**
  167.      * @return Collection<int, EntreeStock>
  168.      */
  169.     public function getEntreeStocks(): Collection
  170.     {
  171.         return $this->entreeStocks;
  172.     }
  173.     public function addEntreeStock(EntreeStock $entreeStock): static
  174.     {
  175.         if (!$this->entreeStocks->contains($entreeStock)) {
  176.             $this->entreeStocks->add($entreeStock);
  177.             $entreeStock->setBoutique($this);
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeEntreeStock(EntreeStock $entreeStock): static
  182.     {
  183.         if ($this->entreeStocks->removeElement($entreeStock)) {
  184.             // set the owning side to null (unless already changed)
  185.             if ($entreeStock->getBoutique() === $this) {
  186.                 $entreeStock->setBoutique(null);
  187.             }
  188.         }
  189.         return $this;
  190.     }
  191.     public function isIsMere(): ?bool
  192.     {
  193.         return $this->isMere;
  194.     }
  195.     public function setIsMere(?bool $isMere): static
  196.     {
  197.         $this->isMere $isMere;
  198.         return $this;
  199.     }
  200.     /**
  201.      * @return Collection<int, User>
  202.      */
  203.     public function getUsers(): Collection
  204.     {
  205.         return $this->users;
  206.     }
  207.     public function addUser(User $user): static
  208.     {
  209.         if (!$this->users->contains($user)) {
  210.             $this->users->add($user);
  211.             $user->setBoutique($this);
  212.         }
  213.         return $this;
  214.     }
  215.     public function removeUser(User $user): static
  216.     {
  217.         if ($this->users->removeElement($user)) {
  218.             // set the owning side to null (unless already changed)
  219.             if ($user->getBoutique() === $this) {
  220.                 $user->setBoutique(null);
  221.             }
  222.         }
  223.         return $this;
  224.     }
  225.     /**
  226.      * @return Collection<int, Recette>
  227.      */
  228.     public function getRecettes(): Collection
  229.     {
  230.         return $this->recettes;
  231.     }
  232.     public function addRecette(Recette $recette): static
  233.     {
  234.         if (!$this->recettes->contains($recette)) {
  235.             $this->recettes->add($recette);
  236.             $recette->setBoutique($this);
  237.         }
  238.         return $this;
  239.     }
  240.     public function removeRecette(Recette $recette): static
  241.     {
  242.         if ($this->recettes->removeElement($recette)) {
  243.             // set the owning side to null (unless already changed)
  244.             if ($recette->getBoutique() === $this) {
  245.                 $recette->setBoutique(null);
  246.             }
  247.         }
  248.         return $this;
  249.     }
  250. }