src/Entity/System/ProductAttribute.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * ProductAttribute
  8.  *
  9.  * @ORM\Table(name="ps_product_attribute")
  10.  *
  11.  * @ORM\Entity(repositoryClass="App\Repository\System\ProductAttributeRepository")
  12.  */
  13. class ProductAttribute
  14. {
  15.     public const CM_SUFFIX '_CM';
  16.     public const MP_SUFFIX '_MP';
  17.     public const PARENT_DEFAULT_ID 0;
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id_product_attribute", type="integer")
  22.      *
  23.      * @ORM\Id
  24.      *
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @var string|null
  30.      *
  31.      * @ORM\Column(name="ean13", type="string", length=13, nullable=true)
  32.      */
  33.     private $ean;
  34.     /**
  35.      * @var string|null
  36.      *
  37.      * @ORM\Column(name="ean13_2", type="string", length=13, nullable=true)
  38.      */
  39.     private $eanVirtual;
  40.     /**
  41.      * @var string|null
  42.      *
  43.      * @ORM\Column(name="reference", type="string", length=32, nullable=true)
  44.      */
  45.     private $sku;
  46.     /**
  47.      * @var bool
  48.      *
  49.      * @ORM\Column(name="default_on", type="boolean")
  50.      */
  51.     private $defaultOn;
  52.     /**
  53.      * @var int|null
  54.      *
  55.      * @ORM\Column(name="supplier_reference", type="integer", nullable=true)
  56.      */
  57.     private $supplier;
  58.     /**
  59.      * @var Product
  60.      *
  61.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Product", inversedBy="productAttributes", cascade={"persist"})
  62.      *
  63.      * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product")
  64.      */
  65.     private $product;
  66.     /**
  67.      * @var float|null
  68.      *
  69.      * @ORM\Column(name="height", type="float", nullable=true)
  70.      */
  71.     private $height;
  72.     /**
  73.      * @var float
  74.      *
  75.      * @ORM\Column(name="weight", type="float")
  76.      */
  77.     private $weight;
  78.     /**
  79.      * @var float|null
  80.      *
  81.      * @ORM\Column(name="width", type="float", nullable=true)
  82.      */
  83.     private $width;
  84.     /**
  85.      * @var float|null
  86.      *
  87.      * @ORM\Column(name="depth", type="float", nullable=true)
  88.      */
  89.     private $depth;
  90.     /**
  91.      * @var float
  92.      *
  93.      * @ORM\Column(name="price", type="float")
  94.      */
  95.     private $price;
  96.     /**
  97.      * @var float
  98.      *
  99.      * @ORM\Column(name="wholesale_price", type="float")
  100.      */
  101.     private $wholesalePrice;
  102.     /**
  103.      * @var int
  104.      *
  105.      * @ORM\Column(name="palet", type="integer")
  106.      */
  107.     private $palletUnits;
  108.     /**
  109.      * @var int
  110.      *
  111.      * @ORM\Column(name="position", type="integer")
  112.      */
  113.     private $position;
  114.     /**
  115.      * @var int
  116.      *
  117.      * @ORM\Column(name="box", type="integer")
  118.      */
  119.     private $boxUnits;
  120.     /**
  121.      * @var string|null
  122.      *
  123.      * @ORM\Column(name="logistic_class", type="string")
  124.      */
  125.     private $logisticClass;
  126.     /**
  127.      * @var ProductDate
  128.      *
  129.      * @ORM\OneToOne(targetEntity="App\Entity\System\ProductDate", mappedBy="productAttribute")
  130.      */
  131.     private $productDate;
  132.     /**
  133.      * @var StockAvailable
  134.      *
  135.      * @ORM\OneToOne(targetEntity="StockAvailable", mappedBy="productAttribute", cascade={"persist", "remove"})
  136.      */
  137.     private $stock;
  138.     /**
  139.      * @var FutureStock|null
  140.      *
  141.      * @ORM\OneToOne(targetEntity="FutureStock", mappedBy="productAttribute", cascade={"persist", "remove"})
  142.      */
  143.     private $futureStock;
  144.     /**
  145.      * @var SpecificPrice[]
  146.      *
  147.      * @ORM\OneToMany(targetEntity="SpecificPrice", mappedBy="productAttribute", cascade={"persist", "remove"})
  148.      */
  149.     private $specificPrices;
  150.     /**
  151.      * @var float|null
  152.      *
  153.      * @ORM\Column(name="estimate_cost_price", type="float", nullable=true)
  154.      */
  155.     private $estimateCostPrice;
  156.     /**
  157.      * @var float
  158.      *
  159.      * @ORM\Column(name="unit_price_impact", type="float")
  160.      */
  161.     private $unitPriceImpact;
  162.     /**
  163.      * @var MinimumOrderQuantity[]
  164.      *
  165.      * @ORM\OneToMany(targetEntity="MinimumOrderQuantity", mappedBy="productAttribute", cascade={"persist", "remove"})
  166.      */
  167.     private $minimumOrderQuantitys;
  168.     /**
  169.      * @var Collection<int, ProductEan>|ProductEan[]
  170.      *
  171.      * @ORM\OneToMany(targetEntity="ProductEan", mappedBy="productAttribute", cascade={"persist"})
  172.      */
  173.     private $productEans;
  174.     /**
  175.      * @var Collection<int, Attribute>|Attribute[]
  176.      *
  177.      * @ORM\ManyToMany(targetEntity="App\Entity\System\Attribute")
  178.      *
  179.      * @ORM\JoinTable(
  180.      *    name="ps_product_attribute_combination",
  181.      *    joinColumns={@ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute", fieldName="id")},
  182.      *    inverseJoinColumns={@ORM\JoinColumn(name="id_attribute", referencedColumnName="id_attribute", fieldName="id")}
  183.      *  )
  184.      */
  185.     private Collection $attributes;
  186.     /**
  187.      * @ORM\Column(name="buybox", type="boolean")
  188.      */
  189.     private bool $buyBox;
  190.     /**
  191.      * @var float
  192.      *
  193.      * @ORM\Column(name="wholesale_price_old", type="float")
  194.      */
  195.     private $wholesalePriceOld;
  196.     /**
  197.      * @var float
  198.      *
  199.      * @ORM\Column(name="unit_price_impact_old", type="float")
  200.      */
  201.     private $unitPriceImpactOld;
  202.     /**
  203.      * @ORM\Column(type="string", length=128)
  204.      */
  205.     private ?string $partNumber null;
  206.     /**
  207.      * * @ORM\Column(type="float")
  208.      */
  209.     private ?float $canon null;
  210.     /**
  211.      * ProductAttribute constructor.
  212.      */
  213.     public function __construct()
  214.     {
  215.         $this->minimumOrderQuantitys = new ArrayCollection();
  216.         $this->specificPrices = new ArrayCollection();
  217.         $this->productEans = new ArrayCollection();
  218.         $this->attributes = new ArrayCollection();
  219.         $this->buyBox false;
  220.     }
  221.     /**
  222.      * @return int
  223.      */
  224.     public function getId(): int
  225.     {
  226.         return $this->id;
  227.     }
  228.     /**
  229.      * @return string|null
  230.      */
  231.     public function getEan(): ?string
  232.     {
  233.         return $this->ean;
  234.     }
  235.     /**
  236.      * @param string|null $ean
  237.      *
  238.      * @return ProductAttribute
  239.      */
  240.     public function setEan(?string $ean): ProductAttribute
  241.     {
  242.         $this->ean $ean;
  243.         return $this;
  244.     }
  245.     /**
  246.      * @return string|null
  247.      */
  248.     public function getEanVirtual(): ?string
  249.     {
  250.         return $this->eanVirtual;
  251.     }
  252.     /**
  253.      * @param string|null $eanVirtual
  254.      *
  255.      * @return ProductAttribute
  256.      */
  257.     public function setEanVirtual(?string $eanVirtual): ProductAttribute
  258.     {
  259.         $this->eanVirtual $eanVirtual;
  260.         return $this;
  261.     }
  262.     /**
  263.      * @return string|null
  264.      */
  265.     public function getSku(): ?string
  266.     {
  267.         return $this->sku;
  268.     }
  269.     /**
  270.      * @param string|null $sku
  271.      *
  272.      * @return ProductAttribute
  273.      */
  274.     public function setSku(?string $sku): ProductAttribute
  275.     {
  276.         $this->sku $sku;
  277.         return $this;
  278.     }
  279.     /**
  280.      * @return bool
  281.      */
  282.     public function isDefaultOn(): bool
  283.     {
  284.         return $this->defaultOn;
  285.     }
  286.     /**
  287.      * @param bool $defaultOn
  288.      *
  289.      * @return ProductAttribute
  290.      */
  291.     public function setDefaultOn(bool $defaultOn): ProductAttribute
  292.     {
  293.         $this->defaultOn $defaultOn;
  294.         return $this;
  295.     }
  296.     /**
  297.      * @return int|null
  298.      */
  299.     public function getSupplier(): ?int
  300.     {
  301.         return $this->supplier;
  302.     }
  303.     /**
  304.      * @param int|null $supplier
  305.      *
  306.      * @return ProductAttribute
  307.      */
  308.     public function setSupplier(?int $supplier): ProductAttribute
  309.     {
  310.         $this->supplier $supplier;
  311.         return $this;
  312.     }
  313.     public function getProduct(): Product
  314.     {
  315.         return $this->product;
  316.     }
  317.     /**
  318.      * @param Product $product
  319.      *
  320.      * @return ProductAttribute
  321.      */
  322.     public function setProduct(Product $product): ProductAttribute
  323.     {
  324.         $this->product $product;
  325.         return $this;
  326.     }
  327.     /**
  328.      * @return float|null
  329.      */
  330.     public function getHeight(): ?float
  331.     {
  332.         return $this->height;
  333.     }
  334.     /**
  335.      * @param float|null $height
  336.      *
  337.      * @return ProductAttribute
  338.      */
  339.     public function setHeight(?float $height): ProductAttribute
  340.     {
  341.         $this->height $height;
  342.         return $this;
  343.     }
  344.     /**
  345.      * @return float
  346.      */
  347.     public function getWeight(): float
  348.     {
  349.         return $this->weight;
  350.     }
  351.     /**
  352.      * @param float $weight
  353.      *
  354.      * @return ProductAttribute
  355.      */
  356.     public function setWeight(float $weight): ProductAttribute
  357.     {
  358.         $this->weight $weight;
  359.         return $this;
  360.     }
  361.     /**
  362.      * @return float|null
  363.      */
  364.     public function getWidth(): ?float
  365.     {
  366.         return $this->width;
  367.     }
  368.     /**
  369.      * @param float|null $width
  370.      *
  371.      * @return ProductAttribute
  372.      */
  373.     public function setWidth(?float $width): ProductAttribute
  374.     {
  375.         $this->width $width;
  376.         return $this;
  377.     }
  378.     /**
  379.      * @return float|null
  380.      */
  381.     public function getDepth(): ?float
  382.     {
  383.         return $this->depth;
  384.     }
  385.     /**
  386.      * @param float|null $depth
  387.      *
  388.      * @return ProductAttribute
  389.      */
  390.     public function setDepth(?float $depth): ProductAttribute
  391.     {
  392.         $this->depth $depth;
  393.         return $this;
  394.     }
  395.     /**
  396.      * @return float
  397.      */
  398.     public function getPrice(): float
  399.     {
  400.         return $this->price;
  401.     }
  402.     /**
  403.      * @param float $price
  404.      *
  405.      * @return ProductAttribute
  406.      */
  407.     public function setPrice(float $price): ProductAttribute
  408.     {
  409.         $this->price $price;
  410.         return $this;
  411.     }
  412.     /**
  413.      * @return float
  414.      */
  415.     public function getWholesalePrice(): float
  416.     {
  417.         return $this->wholesalePrice;
  418.     }
  419.     /**
  420.      * @param float $wholesalePrice
  421.      *
  422.      * @return ProductAttribute
  423.      */
  424.     public function setWholesalePrice(float $wholesalePrice): ProductAttribute
  425.     {
  426.         $this->wholesalePrice $wholesalePrice;
  427.         return $this;
  428.     }
  429.     /**
  430.      * @return int
  431.      */
  432.     public function getPalletUnits(): int
  433.     {
  434.         return $this->palletUnits;
  435.     }
  436.     /**
  437.      * @param int $palletUnits
  438.      *
  439.      * @return ProductAttribute
  440.      */
  441.     public function setPalletUnits(int $palletUnits): ProductAttribute
  442.     {
  443.         $this->palletUnits $palletUnits;
  444.         return $this;
  445.     }
  446.     /**
  447.      * @return int
  448.      */
  449.     public function getPosition(): int
  450.     {
  451.         return $this->position;
  452.     }
  453.     /**
  454.      * @param int $position
  455.      *
  456.      * @return ProductAttribute
  457.      */
  458.     public function setPosition(int $position): ProductAttribute
  459.     {
  460.         $this->position $position;
  461.         return $this;
  462.     }
  463.     /**
  464.      * @return int
  465.      */
  466.     public function getBoxUnits(): int
  467.     {
  468.         return $this->boxUnits;
  469.     }
  470.     /**
  471.      * @param int $boxUnits
  472.      *
  473.      * @return ProductAttribute
  474.      */
  475.     public function setBoxUnits(int $boxUnits): ProductAttribute
  476.     {
  477.         $this->boxUnits $boxUnits;
  478.         return $this;
  479.     }
  480.     /**
  481.      * @return string|null
  482.      */
  483.     public function getLogisticClass(): ?string
  484.     {
  485.         return $this->logisticClass;
  486.     }
  487.     /**
  488.      * @param string|null $logisticClass
  489.      *
  490.      * @return ProductAttribute
  491.      */
  492.     public function setLogisticClass(?string $logisticClass): ProductAttribute
  493.     {
  494.         $this->logisticClass $logisticClass;
  495.         return $this;
  496.     }
  497.     /**
  498.      * @return StockAvailable
  499.      */
  500.     public function getStock(): StockAvailable
  501.     {
  502.         return $this->stock;
  503.     }
  504.     /**
  505.      * @param StockAvailable $stock
  506.      *
  507.      * @return ProductAttribute
  508.      */
  509.     public function setStock(StockAvailable $stock): ProductAttribute
  510.     {
  511.         $this->stock $stock;
  512.         return $this;
  513.     }
  514.     /**
  515.      * @return SpecificPrice[]
  516.      */
  517.     public function getSpecificPrices(): array
  518.     {
  519.         return $this->specificPrices;
  520.     }
  521.     /**
  522.      * @param SpecificPrice[] $specificPrices
  523.      *
  524.      * @return ProductAttribute
  525.      */
  526.     public function setSpecificPrices(array $specificPrices): ProductAttribute
  527.     {
  528.         $this->specificPrices $specificPrices;
  529.         return $this;
  530.     }
  531.     /**
  532.      * @return float|null
  533.      */
  534.     public function getEstimateCostPrice(): ?float
  535.     {
  536.         return $this->estimateCostPrice;
  537.     }
  538.     /**
  539.      * @param float|null $estimateCostPrice
  540.      *
  541.      * @return ProductAttribute
  542.      */
  543.     public function setEstimateCostPrice(?float $estimateCostPrice): ProductAttribute
  544.     {
  545.         $this->estimateCostPrice $estimateCostPrice;
  546.         return $this;
  547.     }
  548.     /**
  549.      * @return float
  550.      */
  551.     public function getUnitPriceImpact(): float
  552.     {
  553.         return $this->unitPriceImpact;
  554.     }
  555.     /**
  556.      * @param float $unitPriceImpact
  557.      *
  558.      * @return ProductAttribute
  559.      */
  560.     public function setUnitPriceImpact(float $unitPriceImpact): ProductAttribute
  561.     {
  562.         $this->unitPriceImpact $unitPriceImpact;
  563.         return $this;
  564.     }
  565.     /**
  566.      * @return MinimumOrderQuantity[]
  567.      */
  568.     public function getMinimumOrderQuantitys(): array
  569.     {
  570.         return $this->minimumOrderQuantitys;
  571.     }
  572.     /**
  573.      * @param MinimumOrderQuantity[] $minimumOrderQuantitys
  574.      *
  575.      * @return ProductAttribute
  576.      */
  577.     public function setMinimumOrderQuantitys(array $minimumOrderQuantitys): ProductAttribute
  578.     {
  579.         $this->minimumOrderQuantitys $minimumOrderQuantitys;
  580.         return $this;
  581.     }
  582.     /**
  583.      * @return Collection<int, ProductEan>|ProductEan[]
  584.      */
  585.     public function getProductEans(): Collection
  586.     {
  587.         return $this->productEans;
  588.     }
  589.     /**
  590.      * @param Collection<int, ProductEan>|ProductEan[] $productEans
  591.      *
  592.      * @return ProductAttribute
  593.      */
  594.     public function setProductEans($productEans): ProductAttribute
  595.     {
  596.         $this->productEans $productEans;
  597.         return $this;
  598.     }
  599.     /**
  600.      * @return ProductDate
  601.      */
  602.     public function getProductDate(): ProductDate
  603.     {
  604.         return $this->productDate;
  605.     }
  606.     /**
  607.      * @param ProductDate $productDate
  608.      *
  609.      * @return ProductAttribute
  610.      */
  611.     public function setProductDate(ProductDate $productDate): ProductAttribute
  612.     {
  613.         $this->productDate $productDate;
  614.         return $this;
  615.     }
  616.     public function isBuyBox(): bool
  617.     {
  618.         return $this->buyBox;
  619.     }
  620.     public function setBuyBox(bool $buyBox): ProductAttribute
  621.     {
  622.         $this->buyBox $buyBox;
  623.         return $this;
  624.     }
  625.     public function getWholesalePriceOld(): float
  626.     {
  627.         return $this->wholesalePriceOld;
  628.     }
  629.     public function setWholesalePriceOld(float $wholesalePriceOld): ProductAttribute
  630.     {
  631.         $this->wholesalePriceOld $wholesalePriceOld;
  632.         return $this;
  633.     }
  634.     public function getUnitPriceImpactOld(): float
  635.     {
  636.         return $this->unitPriceImpactOld;
  637.     }
  638.     public function setUnitPriceImpactOld(float $unitPriceImpactOld): ProductAttribute
  639.     {
  640.         $this->unitPriceImpactOld $unitPriceImpactOld;
  641.         return $this;
  642.     }
  643.     public function getPartNumber(): ?string
  644.     {
  645.         return $this->partNumber;
  646.     }
  647.     public function setPartNumber(?string $partNumber): ProductAttribute
  648.     {
  649.         $this->partNumber $partNumber;
  650.         return $this;
  651.     }
  652.     public function getCanon(): ?float
  653.     {
  654.         return $this->canon;
  655.     }
  656.     public function setCanon(?float $canon): ProductAttribute
  657.     {
  658.         $this->canon $canon;
  659.         return $this;
  660.     }
  661.     /**
  662.      * @return Collection<int, Attribute>|Attribute[]
  663.      */
  664.     public function getAttributes(): Collection
  665.     {
  666.         return $this->attributes;
  667.     }
  668.     /**
  669.      * @param Collection<int, Attribute>|Attribute[] $attributes
  670.      */
  671.     public function setAttributes(Collection $attributes): ProductAttribute
  672.     {
  673.         $this->attributes $attributes;
  674.         return $this;
  675.     }
  676.     public function getFutureStock(): ?FutureStock
  677.     {
  678.         return $this->futureStock;
  679.     }
  680.     public function setFutureStock(?FutureStock $futureStock): ProductAttribute
  681.     {
  682.         $this->futureStock $futureStock;
  683.         return $this;
  684.     }
  685. }