src/Entity/ProduitVariant.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProduitVariantRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassProduitVariantRepository::class)]
  9. class ProduitVariant
  10. {
  11.     
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.    
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $size null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $color null;
  21.     #[ORM\Column(typeTypes::DECIMALprecision10scale2)]
  22.     private ?string $prix null;
  23.     #[ORM\ManyToOne(inversedBy'produitVariants')]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private ?Produit $produit null;
  26.     #[ORM\Column(typeTypes::DECIMALprecision10scale2)]
  27.     private ?string $qtt null;
  28.     #[ORM\OneToMany(mappedBy'produitVariant'targetEntityCommandeDetails::class)]
  29.     private Collection $commandeDetails;
  30.     #[ORM\ManyToOne(inversedBy'produitVariants')]
  31.     private ?ParamColor $paramColor null;
  32.     #[ORM\ManyToOne(inversedBy'produitVariants')]
  33.     private ?ParamSize $paramSize null;
  34.     public function __construct()
  35.     {
  36.         $this->commandeDetails = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     // public function getSize(): ?string
  43.     // {
  44.     //     return $this->size;
  45.     // }
  46.     // public function setSize(?string $size): static
  47.     // {
  48.     //     $this->size = $size;
  49.     //     return $this;
  50.     // }
  51.     // public function getColor(): ?string
  52.     // {
  53.     //     return $this->color;
  54.     // }
  55.     // public function setColor(?string $color): static
  56.     // {
  57.     //     $this->color = $color;
  58.     //     return $this;
  59.     // }
  60.     public function getPrix(): ?string
  61.     {
  62.         return $this->prix;
  63.     }
  64.     public function setPrix(string $prix): static
  65.     {
  66.         $this->prix $prix;
  67.         return $this;
  68.     }
  69.     public function getProduit(): ?Produit
  70.     {
  71.         return $this->produit;
  72.     }
  73.     public function setProduit(?Produit $produit): static
  74.     {
  75.         $this->produit $produit;
  76.         return $this;
  77.     }
  78.     public function getQtt(): ?string
  79.     {
  80.         return $this->qtt;
  81.     }
  82.     public function setQtt(string $qtt): static
  83.     {
  84.         $this->qtt $qtt;
  85.         return $this;
  86.     }
  87.     public function __toString(): string{
  88.         return $this->color;
  89.     }
  90.     /**
  91.      * @return Collection<int, CommandeDetails>
  92.      */
  93.     public function getCommandeDetails(): Collection
  94.     {
  95.         return $this->commandeDetails;
  96.     }
  97.     public function addCommandeDetail(CommandeDetails $commandeDetail): static
  98.     {
  99.         if (!$this->commandeDetails->contains($commandeDetail)) {
  100.             $this->commandeDetails->add($commandeDetail);
  101.             $commandeDetail->setProduitVariant($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeCommandeDetail(CommandeDetails $commandeDetail): static
  106.     {
  107.         if ($this->commandeDetails->removeElement($commandeDetail)) {
  108.             // set the owning side to null (unless already changed)
  109.             if ($commandeDetail->getProduitVariant() === $this) {
  110.                 $commandeDetail->setProduitVariant(null);
  111.             }
  112.         }
  113.         return $this;
  114.     }
  115.     public function getParamColor(): ?ParamColor
  116.     {
  117.         return $this->paramColor;
  118.     }
  119.     public function setParamColor(?ParamColor $paramColor): static
  120.     {
  121.         $this->paramColor $paramColor;
  122.         return $this;
  123.     }
  124.     public function getParamSize(): ?ParamSize
  125.     {
  126.         return $this->paramSize;
  127.     }
  128.     public function setParamSize(?ParamSize $paramSize): static
  129.     {
  130.         $this->paramSize $paramSize;
  131.         return $this;
  132.     }
  133. }