<?php
namespace App\Entity;
use App\Repository\BoutiqueRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BoutiqueRepository::class)]
class Boutique
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nom = null;
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'boutiques')]
private ?self $boutiqueMere = null;
#[ORM\OneToMany(mappedBy: 'boutiqueMere', targetEntity: self::class)]
private Collection $boutiques;
#[ORM\OneToMany(mappedBy: 'boutique', targetEntity: ProduitStock::class)]
private Collection $produitStock;
#[ORM\OneToMany(mappedBy: 'boutique', targetEntity: SortieStock::class)]
private Collection $sortieStocks;
#[ORM\OneToMany(mappedBy: 'boutique', targetEntity: Vente::class)]
private Collection $ventes;
#[ORM\OneToMany(mappedBy: 'boutique', targetEntity: EntreeStock::class)]
private Collection $entreeStocks;
#[ORM\Column(nullable: true)]
private ?bool $isMere = null;
#[ORM\OneToMany(mappedBy: 'boutique', targetEntity: User::class)]
private Collection $users;
#[ORM\OneToMany(mappedBy: 'boutique', targetEntity: Recette::class)]
private Collection $recettes;
public function __construct()
{
$this->boutiques = new ArrayCollection();
$this->produitStock = new ArrayCollection();
$this->sortieStocks = new ArrayCollection();
$this->ventes = new ArrayCollection();
$this->entreeStocks = new ArrayCollection();
$this->users = new ArrayCollection();
$this->recettes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): static
{
$this->nom = $nom;
return $this;
}
public function getBoutiqueMere(): ?self
{
return $this->boutiqueMere;
}
public function setBoutiqueMere(?self $boutiqueMere): static
{
$this->boutiqueMere = $boutiqueMere;
return $this;
}
/**
* @return Collection<int, self>
*/
public function getBoutiques(): Collection
{
return $this->boutiques;
}
public function addBoutique(self $boutique): static
{
if (!$this->boutiques->contains($boutique)) {
$this->boutiques->add($boutique);
$boutique->setBoutiqueMere($this);
}
return $this;
}
public function removeBoutique(self $boutique): static
{
if ($this->boutiques->removeElement($boutique)) {
// set the owning side to null (unless already changed)
if ($boutique->getBoutiqueMere() === $this) {
$boutique->setBoutiqueMere(null);
}
}
return $this;
}
/**
* @return Collection<int, ProduitStock>
*/
public function getProduitStock(): Collection
{
return $this->produitStock;
}
public function addProduitStock(ProduitStock $produitStock): static
{
if (!$this->produitStock->contains($produitStock)) {
$this->produitStock->add($produitStock);
$produitStock->setBoutique($this);
}
return $this;
}
public function removeProduitStock(ProduitStock $produitStock): static
{
if ($this->produitStock->removeElement($produitStock)) {
// set the owning side to null (unless already changed)
if ($produitStock->getBoutique() === $this) {
$produitStock->setBoutique(null);
}
}
return $this;
}
/**
* @return Collection<int, SortieStock>
*/
public function getSortieStocks(): Collection
{
return $this->sortieStocks;
}
public function addSortieStock(SortieStock $sortieStock): static
{
if (!$this->sortieStocks->contains($sortieStock)) {
$this->sortieStocks->add($sortieStock);
$sortieStock->setBoutique($this);
}
return $this;
}
public function removeSortieStock(SortieStock $sortieStock): static
{
if ($this->sortieStocks->removeElement($sortieStock)) {
// set the owning side to null (unless already changed)
if ($sortieStock->getBoutique() === $this) {
$sortieStock->setBoutique(null);
}
}
return $this;
}
/**
* @return Collection<int, Vente>
*/
public function getVentes(): Collection
{
return $this->ventes;
}
public function addVente(Vente $vente): static
{
if (!$this->ventes->contains($vente)) {
$this->ventes->add($vente);
$vente->setBoutique($this);
}
return $this;
}
public function removeVente(Vente $vente): static
{
if ($this->ventes->removeElement($vente)) {
// set the owning side to null (unless already changed)
if ($vente->getBoutique() === $this) {
$vente->setBoutique(null);
}
}
return $this;
}
/**
* @return Collection<int, EntreeStock>
*/
public function getEntreeStocks(): Collection
{
return $this->entreeStocks;
}
public function addEntreeStock(EntreeStock $entreeStock): static
{
if (!$this->entreeStocks->contains($entreeStock)) {
$this->entreeStocks->add($entreeStock);
$entreeStock->setBoutique($this);
}
return $this;
}
public function removeEntreeStock(EntreeStock $entreeStock): static
{
if ($this->entreeStocks->removeElement($entreeStock)) {
// set the owning side to null (unless already changed)
if ($entreeStock->getBoutique() === $this) {
$entreeStock->setBoutique(null);
}
}
return $this;
}
public function isIsMere(): ?bool
{
return $this->isMere;
}
public function setIsMere(?bool $isMere): static
{
$this->isMere = $isMere;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): static
{
if (!$this->users->contains($user)) {
$this->users->add($user);
$user->setBoutique($this);
}
return $this;
}
public function removeUser(User $user): static
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getBoutique() === $this) {
$user->setBoutique(null);
}
}
return $this;
}
/**
* @return Collection<int, Recette>
*/
public function getRecettes(): Collection
{
return $this->recettes;
}
public function addRecette(Recette $recette): static
{
if (!$this->recettes->contains($recette)) {
$this->recettes->add($recette);
$recette->setBoutique($this);
}
return $this;
}
public function removeRecette(Recette $recette): static
{
if ($this->recettes->removeElement($recette)) {
// set the owning side to null (unless already changed)
if ($recette->getBoutique() === $this) {
$recette->setBoutique(null);
}
}
return $this;
}
}