<?phpnamespace App\Entity;use App\Repository\ProduitVariantRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ProduitVariantRepository::class)]class ProduitVariant{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $size = null; #[ORM\Column(length: 255, nullable: true)] private ?string $color = null; #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)] private ?string $prix = null; #[ORM\ManyToOne(inversedBy: 'produitVariants')] #[ORM\JoinColumn(nullable: false)] private ?Produit $produit = null; #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)] private ?string $qtt = null; #[ORM\OneToMany(mappedBy: 'produitVariant', targetEntity: CommandeDetails::class)] private Collection $commandeDetails; #[ORM\ManyToOne(inversedBy: 'produitVariants')] private ?ParamColor $paramColor = null; #[ORM\ManyToOne(inversedBy: 'produitVariants')] private ?ParamSize $paramSize = null; public function __construct() { $this->commandeDetails = new ArrayCollection(); } public function getId(): ?int { return $this->id; } // public function getSize(): ?string // { // return $this->size; // } // public function setSize(?string $size): static // { // $this->size = $size; // return $this; // } // public function getColor(): ?string // { // return $this->color; // } // public function setColor(?string $color): static // { // $this->color = $color; // return $this; // } public function getPrix(): ?string { return $this->prix; } public function setPrix(string $prix): static { $this->prix = $prix; return $this; } public function getProduit(): ?Produit { return $this->produit; } public function setProduit(?Produit $produit): static { $this->produit = $produit; return $this; } public function getQtt(): ?string { return $this->qtt; } public function setQtt(string $qtt): static { $this->qtt = $qtt; return $this; } public function __toString(): string{ return $this->color; } /** * @return Collection<int, CommandeDetails> */ public function getCommandeDetails(): Collection { return $this->commandeDetails; } public function addCommandeDetail(CommandeDetails $commandeDetail): static { if (!$this->commandeDetails->contains($commandeDetail)) { $this->commandeDetails->add($commandeDetail); $commandeDetail->setProduitVariant($this); } return $this; } public function removeCommandeDetail(CommandeDetails $commandeDetail): static { if ($this->commandeDetails->removeElement($commandeDetail)) { // set the owning side to null (unless already changed) if ($commandeDetail->getProduitVariant() === $this) { $commandeDetail->setProduitVariant(null); } } return $this; } public function getParamColor(): ?ParamColor { return $this->paramColor; } public function setParamColor(?ParamColor $paramColor): static { $this->paramColor = $paramColor; return $this; } public function getParamSize(): ?ParamSize { return $this->paramSize; } public function setParamSize(?ParamSize $paramSize): static { $this->paramSize = $paramSize; return $this; }}