src/Entity/ProductVariant.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\BaseLocalizedWebspaceInterface;
  4. use App\Entity\Trait\BaseLocalizedWebspaceTrait;
  5. use App\Repository\ProductVariantRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Sulu\Bundle\MediaBundle\Entity\Media;
  11. #[ORM\Entity(repositoryClassProductVariantRepository::class)]
  12. #[ORM\Table('app_product_variants')]
  13. class ProductVariant implements BaseLocalizedWebspaceInterface
  14. {
  15.     use BaseLocalizedWebspaceTrait;
  16.     public const RESOURCE_KEY 'product_variants';
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue]
  19.     #[ORM\Column]
  20.     private ?int $id null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $productCode null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $title null;
  25.     #[ORM\Column(typeTypes::BOOLEAN)]
  26.     private ?bool $active true;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $category null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $family null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $type null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $fixation null;
  35.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  36.     private ?int $luminousFlux null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $cri null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $chromaticity null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $dispersionVariant null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $protectClass null;
  45.     #[ORM\Column(length255nullabletrue)]
  46.     private ?string $radiationDirect null;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $shape null;
  49.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  50.     private ?int $dimensionA null;
  51.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  52.     private ?int $dimensionB null;
  53.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  54.     private ?int $dimensionC null;
  55.     #[ORM\Column(length255nullabletrue)]
  56.     private ?string $color null;
  57.     #[ORM\Column(length255nullabletrue)]
  58.     private ?string $tempMax null;
  59.     #[ORM\Column(length255nullabletrue)]
  60.     private ?string $tempMin null;
  61.     #[ORM\Column(typeTypes::FLOATnullabletrue)]
  62.     private ?float $inputPower null;
  63.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  64.     private ?int $efficiency null;
  65.     #[ORM\Column(length255nullabletrue)]
  66.     private ?string $protectClassEl null;
  67.     #[ORM\Column(length255nullabletrue)]
  68.     private ?string $supplyVoltage null;
  69.     #[ORM\Column(length255nullabletrue)]
  70.     private ?string $resourceType null;
  71.     #[ORM\Column(typeTypes::BOOLEAN)]
  72.     private ?string $statusNew null;
  73.     #[ORM\Column(length255nullabletrue)]
  74.     private ?string $mechanicalDurability null;
  75.     #[ORM\Column(length255nullabletrue)]
  76.     private ?string $dispersion null;
  77.     #[ORM\Column(length255nullabletrue)]
  78.     private ?string $driver null;
  79.     #[ORM\Column(length255nullabletrue)]
  80.     private ?string $supplements null;
  81.     #[ORM\Column(length255nullabletrue)]
  82.     private ?string $dimension null;
  83.     #[ORM\Column(length255nullabletrue)]
  84.     private ?string $colorRal null;
  85.     #[ORM\Column(length255nullabletrue)]
  86.     private ?string $material null;
  87.     #[ORM\Column(length255nullabletrue)]
  88.     private ?string $driverFunction null;
  89.     #[ORM\Column(typeTypes::FLOATnullabletrue)]
  90.     private ?float $weight null;
  91.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  92.     private ?int $luminousFluxSupply null;
  93.     #[ORM\Column(length255nullabletrue)]
  94.     private ?string $aliveLed null;
  95.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  96.     private ?int $guarantee null;
  97.     #[ORM\Column(length255nullabletrue)]
  98.     private ?string $variantUse null;
  99.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  100.     private ?string $accessories null;
  101.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  102.     private ?string $description null;
  103.     #[ORM\ManyToMany(targetEntityMedia::class, fetch'EXTRA_LAZY')]
  104.     #[ORM\JoinTable(name'app_product_variant_images')]
  105.     private Collection $images;
  106.     #[ORM\ManyToMany(targetEntityMedia::class, fetch'EXTRA_LAZY')]
  107.     #[ORM\JoinTable(name'app_product_variant_renders')]
  108.     private Collection $renders;
  109.     #[ORM\ManyToMany(targetEntityMedia::class, fetch'EXTRA_LAZY')]
  110.     #[ORM\JoinTable(name'app_product_variant_files')]
  111.     private Collection $files;
  112.     #[ORM\ManyToOne(fetch'EXTRA_LAZY')]
  113.     #[ORM\JoinColumn(referencedColumnName'id'onDelete'SET NULL')]
  114.     private ?Media $image null;
  115.     #[ORM\ManyToOne(fetch'EXTRA_LAZY'inversedBy'productVariants')]
  116.     #[ORM\JoinColumn(referencedColumnName'id'onDelete'SET NULL')]
  117.     private ?Product $product null;
  118.     #[ORM\ManyToOne(fetch'EXTRA_LAZY')]
  119.     #[ORM\JoinColumn(referencedColumnName'id'onDelete'SET NULL')]
  120.     private ?ProductFamily $productFamily null;
  121.     #[ORM\ManyToOne(fetch'EXTRA_LAZY')]
  122.     #[ORM\JoinColumn(referencedColumnName'id'onDelete'SET NULL')]
  123.     private ?ProductCategory $productCategory null;
  124.     #[ORM\ManyToOne(fetch'EXTRA_LAZY')]
  125.     #[ORM\JoinColumn(referencedColumnName'id'onDelete'SET NULL')]
  126.     private ?Media $imageSchema null;
  127.     #[ORM\ManyToOne(fetch'EXTRA_LAZY')]
  128.     #[ORM\JoinColumn(referencedColumnName'id'onDelete'SET NULL')]
  129.     private ?Media $imageCurves null;
  130.     #[ORM\ManyToOne(fetch'EXTRA_LAZY')]
  131.     #[ORM\JoinColumn(referencedColumnName'id'onDelete'SET NULL')]
  132.     private ?Media $ltdCurves null;
  133.     public function __construct()
  134.     {
  135.         $this->images = new ArrayCollection();
  136.         $this->renders = new ArrayCollection();
  137.         $this->files = new ArrayCollection();
  138.     }
  139.     public function getId(): ?int
  140.     {
  141.         return $this->id;
  142.     }
  143.     public function getTitle(): ?string
  144.     {
  145.         return $this->title;
  146.     }
  147.     public function setTitle(string $title): static
  148.     {
  149.         $this->title $title;
  150.         return $this;
  151.     }
  152.     public function getProductCode(): ?string
  153.     {
  154.         return $this->productCode;
  155.     }
  156.     public function setProductCode(?string $productCode): static
  157.     {
  158.         $this->productCode $productCode;
  159.         return $this;
  160.     }
  161.     public function getActive(): ?bool
  162.     {
  163.         return $this->active;
  164.     }
  165.     public function setActive(?bool $active): static
  166.     {
  167.         $this->active $active;
  168.         return $this;
  169.     }
  170.     public function getCategory(): ?string
  171.     {
  172.         return $this->category;
  173.     }
  174.     public function setCategory(?string $category): static
  175.     {
  176.         $this->category $category;
  177.         return $this;
  178.     }
  179.     public function getFamily(): ?string
  180.     {
  181.         return $this->family;
  182.     }
  183.     public function setFamily(?string $family): static
  184.     {
  185.         $this->family $family;
  186.         return $this;
  187.     }
  188.     public function getProduct(): ?Product
  189.     {
  190.         return $this->product;
  191.     }
  192.     public function setProduct(?Product $product): static
  193.     {
  194.         $this->product $product;
  195.         return $this;
  196.     }
  197.     public function isProduct(): bool
  198.     {
  199.         return isset($this->product);
  200.     }
  201.     public function getProductFamily(): ?ProductFamily
  202.     {
  203.         return $this->productFamily;
  204.     }
  205.     public function setProductFamily(?ProductFamily $productFamily): static
  206.     {
  207.         $this->productFamily $productFamily;
  208.         return $this;
  209.     }
  210.     public function isProductFamily(): bool
  211.     {
  212.         return isset($this->productFamily);
  213.     }
  214.     public function getProductCategory(): ?ProductCategory
  215.     {
  216.         return $this->productCategory;
  217.     }
  218.     public function setProductCategory(?ProductCategory $productCategory): static
  219.     {
  220.         $this->productCategory $productCategory;
  221.         return $this;
  222.     }
  223.     public function isProductCategory(): bool
  224.     {
  225.         return isset($this->productCategory);
  226.     }
  227.     public function getImage(): ?Media
  228.     {
  229.         return $this->image;
  230.     }
  231.     public function setImage(?Media $image): static
  232.     {
  233.         $this->image $image;
  234.         return $this;
  235.     }
  236.     public function isImage(): bool
  237.     {
  238.         return isset($this->image);
  239.     }
  240.     public function getImageSchema(): ?Media
  241.     {
  242.         return $this->imageSchema;
  243.     }
  244.     public function setImageSchema(?Media $imageSchema): static
  245.     {
  246.         $this->imageSchema $imageSchema;
  247.         return $this;
  248.     }
  249.     public function isImageSchema(): bool
  250.     {
  251.         return isset($this->imageSchema);
  252.     }
  253.     public function getImageCurves(): ?Media
  254.     {
  255.         return $this->imageCurves;
  256.     }
  257.     public function setImageCurves(?Media $imageCurves): static
  258.     {
  259.         $this->imageCurves $imageCurves;
  260.         return $this;
  261.     }
  262.     public function isImageCurves(): bool
  263.     {
  264.         return isset($this->imageCurves);
  265.     }
  266.     public function getLtdCurves(): ?Media
  267.     {
  268.         return $this->ltdCurves;
  269.     }
  270.     public function setLtdCurves(?Media $ltdCurves): static
  271.     {
  272.         $this->ltdCurves $ltdCurves;
  273.         return $this;
  274.     }
  275.     public function isLtdCurves(): bool
  276.     {
  277.         return isset($this->ltdCurves);
  278.     }
  279.     public function getDescription(): ?string
  280.     {
  281.         return $this->description;
  282.     }
  283.     public function setDescription(?string $description): static
  284.     {
  285.         $this->description $description;
  286.         return $this;
  287.     }
  288.     public function getType(): ?string
  289.     {
  290.         return $this->type;
  291.     }
  292.     public function setType(?string $type): static
  293.     {
  294.         $this->type $type;
  295.         return $this;
  296.     }
  297.     public function getFixation(): ?string
  298.     {
  299.         return $this->fixation;
  300.     }
  301.     public function setFixation(?string $fixation): static
  302.     {
  303.         $this->fixation $fixation;
  304.         return $this;
  305.     }
  306.     public function getLuminousFlux(): ?int
  307.     {
  308.         return $this->luminousFlux;
  309.     }
  310.     public function setLuminousFlux(?int $luminousFlux): static
  311.     {
  312.         $this->luminousFlux $luminousFlux;
  313.         return $this;
  314.     }
  315.     public function getCri(): ?string
  316.     {
  317.         return $this->cri;
  318.     }
  319.     public function setCri(?string $cri): static
  320.     {
  321.         $this->cri $cri;
  322.         return $this;
  323.     }
  324.     public function getChromaticity(): ?string
  325.     {
  326.         return $this->chromaticity;
  327.     }
  328.     public function setChromaticity(?string $chromaticity): static
  329.     {
  330.         $this->chromaticity $chromaticity;
  331.         return $this;
  332.     }
  333.     public function getDispersionVariant(): ?string
  334.     {
  335.         return $this->dispersionVariant;
  336.     }
  337.     public function setDispersionVariant(?string $dispersionVariant): static
  338.     {
  339.         $this->dispersionVariant $dispersionVariant;
  340.         return $this;
  341.     }
  342.     public function getProtectClass(): ?string
  343.     {
  344.         return $this->protectClass;
  345.     }
  346.     public function setProtectClass(?string $protectClass): static
  347.     {
  348.         $this->protectClass $protectClass;
  349.         return $this;
  350.     }
  351.     public function getRadiationDirect(): ?string
  352.     {
  353.         return $this->radiationDirect;
  354.     }
  355.     public function setRadiationDirect(?string $radiationDirect): static
  356.     {
  357.         $this->radiationDirect $radiationDirect;
  358.         return $this;
  359.     }
  360.     public function getShape(): ?string
  361.     {
  362.         return $this->shape;
  363.     }
  364.     public function setShape(?string $shape): static
  365.     {
  366.         $this->shape $shape;
  367.         return $this;
  368.     }
  369.     public function getDimensionA(): ?int
  370.     {
  371.         return $this->dimensionA;
  372.     }
  373.     public function setDimensionA(?int $dimensionA): static
  374.     {
  375.         $this->dimensionA $dimensionA;
  376.         return $this;
  377.     }
  378.     public function getDimensionB(): ?int
  379.     {
  380.         return $this->dimensionB;
  381.     }
  382.     public function setDimensionB(?int $dimensionB): static
  383.     {
  384.         $this->dimensionB $dimensionB;
  385.         return $this;
  386.     }
  387.     public function getDimensionC(): ?int
  388.     {
  389.         return $this->dimensionC;
  390.     }
  391.     public function setDimensionC(?int $dimensionC): static
  392.     {
  393.         $this->dimensionC $dimensionC;
  394.         return $this;
  395.     }
  396.     public function getColor(): ?string
  397.     {
  398.         return $this->color;
  399.     }
  400.     public function setColor(?string $color): static
  401.     {
  402.         $this->color $color;
  403.         return $this;
  404.     }
  405.     public function getTempMax(): ?string
  406.     {
  407.         return $this->tempMax;
  408.     }
  409.     public function setTempMax(?string $tempMax): static
  410.     {
  411.         $this->tempMax $tempMax;
  412.         return $this;
  413.     }
  414.     public function getTempMin(): ?string
  415.     {
  416.         return $this->tempMin;
  417.     }
  418.     public function setTempMin(?string $tempMin): static
  419.     {
  420.         $this->tempMin $tempMin;
  421.         return $this;
  422.     }
  423.     public function getInputPower(): ?float
  424.     {
  425.         return $this->inputPower;
  426.     }
  427.     public function setInputPower(?float $inputPower): static
  428.     {
  429.         $this->inputPower $inputPower;
  430.         return $this;
  431.     }
  432.     public function getEfficiency(): ?int
  433.     {
  434.         return $this->efficiency;
  435.     }
  436.     public function setEfficiency(?int $efficiency): static
  437.     {
  438.         $this->efficiency $efficiency;
  439.         return $this;
  440.     }
  441.     public function getProtectClassEl(): ?string
  442.     {
  443.         return $this->protectClassEl;
  444.     }
  445.     public function setProtectClassEl(?string $protectClassEl): static
  446.     {
  447.         $this->protectClassEl $protectClassEl;
  448.         return $this;
  449.     }
  450.     public function getSupplyVoltage(): ?string
  451.     {
  452.         return $this->supplyVoltage;
  453.     }
  454.     public function setSupplyVoltage(?string $supplyVoltage): static
  455.     {
  456.         $this->supplyVoltage $supplyVoltage;
  457.         return $this;
  458.     }
  459.     public function getResourceType(): ?string
  460.     {
  461.         return $this->resourceType;
  462.     }
  463.     public function setResourceType(?string $resourceType): static
  464.     {
  465.         $this->resourceType $resourceType;
  466.         return $this;
  467.     }
  468.     public function getStatusNew(): ?bool
  469.     {
  470.         return $this->statusNew;
  471.     }
  472.     public function setStatusNew(?bool $statusNew): static
  473.     {
  474.         $this->statusNew $statusNew;
  475.         return $this;
  476.     }
  477.     public function getMechanicalDurability(): ?string
  478.     {
  479.         return $this->mechanicalDurability;
  480.     }
  481.     public function setMechanicalDurability(?string $mechanicalDurability): static
  482.     {
  483.         $this->mechanicalDurability $mechanicalDurability;
  484.         return $this;
  485.     }
  486.     public function getDispersion(): ?string
  487.     {
  488.         return $this->dispersion;
  489.     }
  490.     public function setDispersion(?string $dispersion): static
  491.     {
  492.         $this->dispersion $dispersion;
  493.         return $this;
  494.     }
  495.     public function getDriver(): ?string
  496.     {
  497.         return $this->driver;
  498.     }
  499.     public function setDriver(?string $driver): static
  500.     {
  501.         $this->driver $driver;
  502.         return $this;
  503.     }
  504.     public function getSupplements(): ?string
  505.     {
  506.         return $this->supplements;
  507.     }
  508.     public function setSupplements(?string $supplements): static
  509.     {
  510.         $this->supplements $supplements;
  511.         return $this;
  512.     }
  513.     public function getDimension(): ?string
  514.     {
  515.         return $this->dimension;
  516.     }
  517.     public function setDimension(?string $dimension): static
  518.     {
  519.         $this->dimension $dimension;
  520.         return $this;
  521.     }
  522.     public function getColorRal(): ?string
  523.     {
  524.         return $this->colorRal;
  525.     }
  526.     public function setColorRal(?string $colorRal): static
  527.     {
  528.         $this->colorRal $colorRal;
  529.         return $this;
  530.     }
  531.     public function getMaterial(): ?string
  532.     {
  533.         return $this->material;
  534.     }
  535.     public function setMaterial(?string $material): static
  536.     {
  537.         $this->material $material;
  538.         return $this;
  539.     }
  540.     public function getDriverFunction(): ?string
  541.     {
  542.         return $this->driverFunction;
  543.     }
  544.     public function setDriverFunction(?string $driverFunction): static
  545.     {
  546.         $this->driverFunction $driverFunction;
  547.         return $this;
  548.     }
  549.     public function getWeight(): ?float
  550.     {
  551.         return $this->weight;
  552.     }
  553.     public function setWeight(?float $weight): static
  554.     {
  555.         $this->weight $weight;
  556.         return $this;
  557.     }
  558.     public function getLuminousFluxSupply(): ?int
  559.     {
  560.         return $this->luminousFluxSupply;
  561.     }
  562.     public function setLuminousFluxSupply(?int $luminousFluxSupply): static
  563.     {
  564.         $this->luminousFluxSupply $luminousFluxSupply;
  565.         return $this;
  566.     }
  567.     public function getAliveLed(): ?string
  568.     {
  569.         return $this->aliveLed;
  570.     }
  571.     public function setAliveLed(?string $aliveLed): static
  572.     {
  573.         $this->aliveLed $aliveLed;
  574.         return $this;
  575.     }
  576.     public function getGuarantee(): ?int
  577.     {
  578.         return $this->guarantee;
  579.     }
  580.     public function setGuarantee(?int $guarantee): static
  581.     {
  582.         $this->guarantee $guarantee;
  583.         return $this;
  584.     }
  585.     public function getUsage(): ?string
  586.     {
  587.         return $this->variantUse;
  588.     }
  589.     public function setUsage(?string $variantUse): static
  590.     {
  591.         $this->variantUse $variantUse;
  592.         return $this;
  593.     }
  594.     public function getAccessories(): ?string
  595.     {
  596.         return $this->accessories;
  597.     }
  598.     public function setAccessories(?string $accessories): static
  599.     {
  600.         $this->accessories $accessories;
  601.         return $this;
  602.     }
  603.     /**
  604.      * @return Collection<int, Media>
  605.      */
  606.     public function getImages(): Collection
  607.     {
  608.         return $this->images;
  609.     }
  610.     public function addImage(Media $image): static
  611.     {
  612.         if (!$this->images->contains($image)) {
  613.             $this->images->add($image);
  614.         }
  615.         return $this;
  616.     }
  617.     public function removeImage(Media $image): static
  618.     {
  619.         $this->images->removeElement($image);
  620.         return $this;
  621.     }
  622.     /**
  623.      * @return Collection<int, Media>
  624.      */
  625.     public function getRenders(): Collection
  626.     {
  627.         return $this->renders;
  628.     }
  629.     public function addRender(Media $render): static
  630.     {
  631.         if (!$this->renders->contains($render)) {
  632.             $this->renders->add($render);
  633.         }
  634.         return $this;
  635.     }
  636.     public function removeRender(Media $render): static
  637.     {
  638.         $this->renders->removeElement($render);
  639.         return $this;
  640.     }
  641.     /**
  642.      * @return Collection<int, Media>
  643.      */
  644.     public function getFiles(): Collection
  645.     {
  646.         return $this->files;
  647.     }
  648.     public function addFile(Media $file): static
  649.     {
  650.         if (!$this->files->contains($file)) {
  651.             $this->files->add($file);
  652.         }
  653.         return $this;
  654.     }
  655.     public function removeFile(Media $file): static
  656.     {
  657.         $this->files->removeElement($file);
  658.         return $this;
  659.     }
  660. }