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'targetEntityRecette::class)]
  31.     private Collection $recettes;
  32.     #[ORM\OneToMany(mappedBy'boutique'targetEntityUser::class)]
  33.     private Collection $users;
  34.     #[ORM\OneToMany(mappedBy'boutique'targetEntityFactureService::class)]
  35.     private Collection $factureServices;
  36.     public function __construct()
  37.     {
  38.         $this->boutiques = new ArrayCollection();
  39.         $this->produitStock = new ArrayCollection();
  40.         $this->sortieStocks = new ArrayCollection();
  41.         $this->ventes = new ArrayCollection();
  42.         $this->entreeStocks = new ArrayCollection();
  43.         $this->recettes = new ArrayCollection();
  44.         $this->users = new ArrayCollection();
  45.         $this->factureServices = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getNom(): ?string
  52.     {
  53.         return $this->nom;
  54.     }
  55.     public function setNom(string $nom): static
  56.     {
  57.         $this->nom $nom;
  58.         return $this;
  59.     }
  60.     public function getBoutiqueMere(): ?self
  61.     {
  62.         return $this->boutiqueMere;
  63.     }
  64.     public function setBoutiqueMere(?self $boutiqueMere): static
  65.     {
  66.         $this->boutiqueMere $boutiqueMere;
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return Collection<int, self>
  71.      */
  72.     public function getBoutiques(): Collection
  73.     {
  74.         return $this->boutiques;
  75.     }
  76.     public function addBoutique(self $boutique): static
  77.     {
  78.         if (!$this->boutiques->contains($boutique)) {
  79.             $this->boutiques->add($boutique);
  80.             $boutique->setBoutiqueMere($this);
  81.         }
  82.         return $this;
  83.     }
  84.     public function removeBoutique(self $boutique): static
  85.     {
  86.         if ($this->boutiques->removeElement($boutique)) {
  87.             // set the owning side to null (unless already changed)
  88.             if ($boutique->getBoutiqueMere() === $this) {
  89.                 $boutique->setBoutiqueMere(null);
  90.             }
  91.         }
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection<int, ProduitStock>
  96.      */
  97.     public function getProduitStock(): Collection
  98.     {
  99.         return $this->produitStock;
  100.     }
  101.     public function addProduitStock(ProduitStock $produitStock): static
  102.     {
  103.         if (!$this->produitStock->contains($produitStock)) {
  104.             $this->produitStock->add($produitStock);
  105.             $produitStock->setBoutique($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removeProduitStock(ProduitStock $produitStock): static
  110.     {
  111.         if ($this->produitStock->removeElement($produitStock)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($produitStock->getBoutique() === $this) {
  114.                 $produitStock->setBoutique(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, SortieStock>
  121.      */
  122.     public function getSortieStocks(): Collection
  123.     {
  124.         return $this->sortieStocks;
  125.     }
  126.     public function addSortieStock(SortieStock $sortieStock): static
  127.     {
  128.         if (!$this->sortieStocks->contains($sortieStock)) {
  129.             $this->sortieStocks->add($sortieStock);
  130.             $sortieStock->setBoutique($this);
  131.         }
  132.         return $this;
  133.     }
  134.     public function removeSortieStock(SortieStock $sortieStock): static
  135.     {
  136.         if ($this->sortieStocks->removeElement($sortieStock)) {
  137.             // set the owning side to null (unless already changed)
  138.             if ($sortieStock->getBoutique() === $this) {
  139.                 $sortieStock->setBoutique(null);
  140.             }
  141.         }
  142.         return $this;
  143.     }
  144.     /**
  145.      * @return Collection<int, Vente>
  146.      */
  147.     public function getVentes(): Collection
  148.     {
  149.         return $this->ventes;
  150.     }
  151.     public function addVente(Vente $vente): static
  152.     {
  153.         if (!$this->ventes->contains($vente)) {
  154.             $this->ventes->add($vente);
  155.             $vente->setBoutique($this);
  156.         }
  157.         return $this;
  158.     }
  159.     public function removeVente(Vente $vente): static
  160.     {
  161.         if ($this->ventes->removeElement($vente)) {
  162.             // set the owning side to null (unless already changed)
  163.             if ($vente->getBoutique() === $this) {
  164.                 $vente->setBoutique(null);
  165.             }
  166.         }
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return Collection<int, EntreeStock>
  171.      */
  172.     public function getEntreeStocks(): Collection
  173.     {
  174.         return $this->entreeStocks;
  175.     }
  176.     public function addEntreeStock(EntreeStock $entreeStock): static
  177.     {
  178.         if (!$this->entreeStocks->contains($entreeStock)) {
  179.             $this->entreeStocks->add($entreeStock);
  180.             $entreeStock->setBoutique($this);
  181.         }
  182.         return $this;
  183.     }
  184.     public function removeEntreeStock(EntreeStock $entreeStock): static
  185.     {
  186.         if ($this->entreeStocks->removeElement($entreeStock)) {
  187.             // set the owning side to null (unless already changed)
  188.             if ($entreeStock->getBoutique() === $this) {
  189.                 $entreeStock->setBoutique(null);
  190.             }
  191.         }
  192.         return $this;
  193.     }
  194.     public function isIsMere(): ?bool
  195.     {
  196.         return $this->isMere;
  197.     }
  198.     public function setIsMere(?bool $isMere): static
  199.     {
  200.         $this->isMere $isMere;
  201.         return $this;
  202.     }
  203.     /**
  204.      * @return Collection<int, Recette>
  205.      */
  206.     public function getRecettes(): Collection
  207.     {
  208.         return $this->recettes;
  209.     }
  210.     public function addRecette(Recette $recette): static
  211.     {
  212.         if (!$this->recettes->contains($recette)) {
  213.             $this->recettes->add($recette);
  214.             $recette->setBoutique($this);
  215.         }
  216.         return $this;
  217.     }
  218.     public function removeRecette(Recette $recette): static
  219.     {
  220.         if ($this->recettes->removeElement($recette)) {
  221.             // set the owning side to null (unless already changed)
  222.             if ($recette->getBoutique() === $this) {
  223.                 $recette->setBoutique(null);
  224.             }
  225.         }
  226.         return $this;
  227.     }
  228.     /**
  229.      * @return Collection<int, User>
  230.      */
  231.     public function getUsers(): Collection
  232.     {
  233.         return $this->users;
  234.     }
  235.     public function addUser(User $user): static
  236.     {
  237.         if (!$this->users->contains($user)) {
  238.             $this->users->add($user);
  239.             $user->setBoutique($this);
  240.         }
  241.         return $this;
  242.     }
  243.     public function removeUser(User $user): static
  244.     {
  245.         if ($this->users->removeElement($user)) {
  246.             // set the owning side to null (unless already changed)
  247.             if ($user->getBoutique() === $this) {
  248.                 $user->setBoutique(null);
  249.             }
  250.         }
  251.         return $this;
  252.     }
  253.      /**
  254.      * @return Collection<int, FactureService>
  255.      */
  256.     public function getFactureServices(): Collection
  257.     {
  258.         return $this->factureServices;
  259.     }
  260.     public function addFactureService(FactureService $factureService): static
  261.     {
  262.         if (!$this->factureServices->contains($factureService)) {
  263.             $this->factureServices->add($factureService);
  264.             $factureService->setBoutique($this);
  265.         }
  266.         return $this;
  267.     }
  268.     public function removeFactureService(FactureService $factureService): static
  269.     {
  270.         if ($this->factureServices->removeElement($factureService)) {
  271.             // set the owning side to null (unless already changed)
  272.             if ($factureService->getBoutique() === $this) {
  273.                 $factureService->setBoutique(null);
  274.             }
  275.         }
  276.         return $this;
  277.     }
  278.   
  279. }