<?phpnamespace App\Entity;use App\Repository\AccessoireRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: AccessoireRepository::class)]class Accessoire{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $nom = null; #[ORM\ManyToOne(inversedBy: 'accessoires')] private ?FamilleAccessoire $familleaccessoire = null; #[ORM\OneToMany(targetEntity: Produits::class, mappedBy: 'accessoire')] private Collection $produits; #[ORM\Column(nullable: true)] private ?bool $IsArchive = false; public function __construct() { $this->produits = 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 getFamilleaccessoire(): ?FamilleAccessoire { return $this->familleaccessoire; } public function setFamilleaccessoire(?FamilleAccessoire $familleaccessoire): static { $this->familleaccessoire = $familleaccessoire; return $this; } /** * @return Collection<int, Produits> */ public function getProduits(): Collection { return $this->produits; } public function addProduit(Produits $produit): static { if (!$this->produits->contains($produit)) { $this->produits->add($produit); $produit->setAccessoire($this); } return $this; } public function removeProduit(Produits $produit): static { if ($this->produits->removeElement($produit)) { // set the owning side to null (unless already changed) if ($produit->getAccessoire() === $this) { $produit->setAccessoire(null); } } return $this; } public function isIsArchive(): ?bool { return $this->IsArchive; } public function setIsArchive(?bool $IsArchive): static { $this->IsArchive = $IsArchive; return $this; }}