src/Entity/System/ProductAttribute.php line 30

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