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.      * ProductAttribute constructor.
  322.      */
  323.     public function __construct()
  324.     {
  325.         $this->minimumOrderQuantitys = new ArrayCollection();
  326.         $this->specificPrices = new ArrayCollection();
  327.         $this->productEans = new ArrayCollection();
  328.         $this->attributes = new ArrayCollection();
  329.         $this->buyBox false;
  330.     }
  331.     /**
  332.      * @return int
  333.      */
  334.     public function getId(): int
  335.     {
  336.         return $this->id;
  337.     }
  338.     /**
  339.      * @return string|null
  340.      */
  341.     public function getEan(): ?string
  342.     {
  343.         return $this->ean;
  344.     }
  345.     /**
  346.      * @param string|null $ean
  347.      *
  348.      * @return ProductAttribute
  349.      */
  350.     public function setEan(?string $ean): ProductAttribute
  351.     {
  352.         $this->ean $ean;
  353.         return $this;
  354.     }
  355.     /**
  356.      * @return string|null
  357.      */
  358.     public function getEanVirtual(): ?string
  359.     {
  360.         return $this->eanVirtual;
  361.     }
  362.     /**
  363.      * @param string|null $eanVirtual
  364.      *
  365.      * @return ProductAttribute
  366.      */
  367.     public function setEanVirtual(?string $eanVirtual): ProductAttribute
  368.     {
  369.         $this->eanVirtual $eanVirtual;
  370.         return $this;
  371.     }
  372.     /**
  373.      * @return string|null
  374.      */
  375.     public function getSku(): ?string
  376.     {
  377.         return $this->sku;
  378.     }
  379.     /**
  380.      * @param string|null $sku
  381.      *
  382.      * @return ProductAttribute
  383.      */
  384.     public function setSku(?string $sku): ProductAttribute
  385.     {
  386.         $this->sku $sku;
  387.         return $this;
  388.     }
  389.     /**
  390.      * @return bool
  391.      */
  392.     public function isDefaultOn(): bool
  393.     {
  394.         return $this->defaultOn;
  395.     }
  396.     /**
  397.      * @param bool $defaultOn
  398.      *
  399.      * @return ProductAttribute
  400.      */
  401.     public function setDefaultOn(bool $defaultOn): ProductAttribute
  402.     {
  403.         $this->defaultOn $defaultOn;
  404.         return $this;
  405.     }
  406.     public function getSupplier(): ?string
  407.     {
  408.         return $this->supplier;
  409.     }
  410.     public function setSupplier(?string $supplier): ProductAttribute
  411.     {
  412.         $this->supplier $supplier;
  413.         return $this;
  414.     }
  415.     public function getProduct(): Product
  416.     {
  417.         return $this->product;
  418.     }
  419.     /**
  420.      * @param Product $product
  421.      *
  422.      * @return ProductAttribute
  423.      */
  424.     public function setProduct(Product $product): ProductAttribute
  425.     {
  426.         $this->product $product;
  427.         return $this;
  428.     }
  429.     /**
  430.      * @return float|null
  431.      */
  432.     public function getHeight(): ?float
  433.     {
  434.         return $this->height;
  435.     }
  436.     /**
  437.      * @param float|null $height
  438.      *
  439.      * @return ProductAttribute
  440.      */
  441.     public function setHeight(?float $height): ProductAttribute
  442.     {
  443.         $this->height $height;
  444.         return $this;
  445.     }
  446.     /**
  447.      * @return float
  448.      */
  449.     public function getWeight(): float
  450.     {
  451.         return $this->weight;
  452.     }
  453.     /**
  454.      * @param float $weight
  455.      *
  456.      * @return ProductAttribute
  457.      */
  458.     public function setWeight(float $weight): ProductAttribute
  459.     {
  460.         $this->weight $weight;
  461.         return $this;
  462.     }
  463.     /**
  464.      * @return float|null
  465.      */
  466.     public function getWidth(): ?float
  467.     {
  468.         return $this->width;
  469.     }
  470.     /**
  471.      * @param float|null $width
  472.      *
  473.      * @return ProductAttribute
  474.      */
  475.     public function setWidth(?float $width): ProductAttribute
  476.     {
  477.         $this->width $width;
  478.         return $this;
  479.     }
  480.     /**
  481.      * @return float|null
  482.      */
  483.     public function getDepth(): ?float
  484.     {
  485.         return $this->depth;
  486.     }
  487.     /**
  488.      * @param float|null $depth
  489.      *
  490.      * @return ProductAttribute
  491.      */
  492.     public function setDepth(?float $depth): ProductAttribute
  493.     {
  494.         $this->depth $depth;
  495.         return $this;
  496.     }
  497.     /**
  498.      * @return float
  499.      */
  500.     public function getPrice(): float
  501.     {
  502.         return $this->price;
  503.     }
  504.     /**
  505.      * @param float $price
  506.      *
  507.      * @return ProductAttribute
  508.      */
  509.     public function setPrice(float $price): ProductAttribute
  510.     {
  511.         $this->price $price;
  512.         return $this;
  513.     }
  514.     /**
  515.      * @return float
  516.      */
  517.     public function getWholesalePrice(): float
  518.     {
  519.         return $this->wholesalePrice;
  520.     }
  521.     /**
  522.      * @param float $wholesalePrice
  523.      *
  524.      * @return ProductAttribute
  525.      */
  526.     public function setWholesalePrice(float $wholesalePrice): ProductAttribute
  527.     {
  528.         $this->wholesalePrice $wholesalePrice;
  529.         return $this;
  530.     }
  531.     /**
  532.      * @return int
  533.      */
  534.     public function getPalletUnits(): int
  535.     {
  536.         return $this->palletUnits;
  537.     }
  538.     /**
  539.      * @param int $palletUnits
  540.      *
  541.      * @return ProductAttribute
  542.      */
  543.     public function setPalletUnits(int $palletUnits): ProductAttribute
  544.     {
  545.         $this->palletUnits $palletUnits;
  546.         return $this;
  547.     }
  548.     /**
  549.      * @return int
  550.      */
  551.     public function getPosition(): int
  552.     {
  553.         return $this->position;
  554.     }
  555.     /**
  556.      * @param int $position
  557.      *
  558.      * @return ProductAttribute
  559.      */
  560.     public function setPosition(int $position): ProductAttribute
  561.     {
  562.         $this->position $position;
  563.         return $this;
  564.     }
  565.     /**
  566.      * @return int
  567.      */
  568.     public function getBoxUnits(): int
  569.     {
  570.         return $this->boxUnits;
  571.     }
  572.     /**
  573.      * @param int $boxUnits
  574.      *
  575.      * @return ProductAttribute
  576.      */
  577.     public function setBoxUnits(int $boxUnits): ProductAttribute
  578.     {
  579.         $this->boxUnits $boxUnits;
  580.         return $this;
  581.     }
  582.     /**
  583.      * @return string|null
  584.      */
  585.     public function getLogisticClass(): ?string
  586.     {
  587.         return $this->logisticClass;
  588.     }
  589.     /**
  590.      * @param string|null $logisticClass
  591.      *
  592.      * @return ProductAttribute
  593.      */
  594.     public function setLogisticClass(?string $logisticClass): ProductAttribute
  595.     {
  596.         $this->logisticClass $logisticClass;
  597.         return $this;
  598.     }
  599.     /**
  600.      * @return StockAvailable
  601.      */
  602.     public function getStock(): StockAvailable
  603.     {
  604.         return $this->stock;
  605.     }
  606.     /**
  607.      * @param StockAvailable $stock
  608.      *
  609.      * @return ProductAttribute
  610.      */
  611.     public function setStock(StockAvailable $stock): ProductAttribute
  612.     {
  613.         $this->stock $stock;
  614.         return $this;
  615.     }
  616.     /**
  617.      * @return SpecificPrice[]
  618.      */
  619.     public function getSpecificPrices(): array
  620.     {
  621.         return $this->specificPrices;
  622.     }
  623.     /**
  624.      * @param SpecificPrice[] $specificPrices
  625.      *
  626.      * @return ProductAttribute
  627.      */
  628.     public function setSpecificPrices(array $specificPrices): ProductAttribute
  629.     {
  630.         $this->specificPrices $specificPrices;
  631.         return $this;
  632.     }
  633.     /**
  634.      * @return float|null
  635.      */
  636.     public function getEstimateCostPrice(): ?float
  637.     {
  638.         return $this->estimateCostPrice;
  639.     }
  640.     /**
  641.      * @param float|null $estimateCostPrice
  642.      *
  643.      * @return ProductAttribute
  644.      */
  645.     public function setEstimateCostPrice(?float $estimateCostPrice): ProductAttribute
  646.     {
  647.         $this->estimateCostPrice $estimateCostPrice;
  648.         return $this;
  649.     }
  650.     /**
  651.      * @return float
  652.      */
  653.     public function getUnitPriceImpact(): float
  654.     {
  655.         return $this->unitPriceImpact;
  656.     }
  657.     /**
  658.      * @param float $unitPriceImpact
  659.      *
  660.      * @return ProductAttribute
  661.      */
  662.     public function setUnitPriceImpact(float $unitPriceImpact): ProductAttribute
  663.     {
  664.         $this->unitPriceImpact $unitPriceImpact;
  665.         return $this;
  666.     }
  667.     /**
  668.      * @return MinimumOrderQuantity[]
  669.      */
  670.     public function getMinimumOrderQuantitys(): array
  671.     {
  672.         return $this->minimumOrderQuantitys;
  673.     }
  674.     /**
  675.      * @param MinimumOrderQuantity[] $minimumOrderQuantitys
  676.      *
  677.      * @return ProductAttribute
  678.      */
  679.     public function setMinimumOrderQuantitys(array $minimumOrderQuantitys): ProductAttribute
  680.     {
  681.         $this->minimumOrderQuantitys $minimumOrderQuantitys;
  682.         return $this;
  683.     }
  684.     /**
  685.      * @return Collection<int, ProductEan>|ProductEan[]
  686.      */
  687.     public function getProductEans(): Collection
  688.     {
  689.         return $this->productEans;
  690.     }
  691.     /**
  692.      * @param Collection<int, ProductEan>|ProductEan[] $productEans
  693.      *
  694.      * @return ProductAttribute
  695.      */
  696.     public function setProductEans($productEans): ProductAttribute
  697.     {
  698.         $this->productEans $productEans;
  699.         return $this;
  700.     }
  701.     /**
  702.      * @return ProductDate
  703.      */
  704.     public function getProductDate(): ProductDate
  705.     {
  706.         return $this->productDate;
  707.     }
  708.     /**
  709.      * @param ProductDate $productDate
  710.      *
  711.      * @return ProductAttribute
  712.      */
  713.     public function setProductDate(ProductDate $productDate): ProductAttribute
  714.     {
  715.         $this->productDate $productDate;
  716.         return $this;
  717.     }
  718.     public function isBuyBox(): bool
  719.     {
  720.         return $this->buyBox;
  721.     }
  722.     public function setBuyBox(bool $buyBox): ProductAttribute
  723.     {
  724.         $this->buyBox $buyBox;
  725.         return $this;
  726.     }
  727.     public function getWholesalePriceOld(): float
  728.     {
  729.         return $this->wholesalePriceOld;
  730.     }
  731.     public function setWholesalePriceOld(float $wholesalePriceOld): ProductAttribute
  732.     {
  733.         $this->wholesalePriceOld $wholesalePriceOld;
  734.         return $this;
  735.     }
  736.     public function getUnitPriceImpactOld(): float
  737.     {
  738.         return $this->unitPriceImpactOld;
  739.     }
  740.     public function setUnitPriceImpactOld(float $unitPriceImpactOld): ProductAttribute
  741.     {
  742.         $this->unitPriceImpactOld $unitPriceImpactOld;
  743.         return $this;
  744.     }
  745.     public function getPartNumber(): ?string
  746.     {
  747.         return $this->partNumber;
  748.     }
  749.     public function setPartNumber(?string $partNumber): ProductAttribute
  750.     {
  751.         $this->partNumber $partNumber;
  752.         return $this;
  753.     }
  754.     public function getCanon(): ?float
  755.     {
  756.         return $this->canon;
  757.     }
  758.     public function setCanon(?float $canon): ProductAttribute
  759.     {
  760.         $this->canon $canon;
  761.         return $this;
  762.     }
  763.     /**
  764.      * @return Collection<int, Attribute>|Attribute[]
  765.      */
  766.     public function getAttributes(): Collection
  767.     {
  768.         return $this->attributes;
  769.     }
  770.     /**
  771.      * @param Collection<int, Attribute>|Attribute[] $attributes
  772.      */
  773.     public function setAttributes(Collection $attributes): ProductAttribute
  774.     {
  775.         $this->attributes $attributes;
  776.         return $this;
  777.     }
  778.     public function getFutureStock(): ?FutureStock
  779.     {
  780.         return $this->futureStock;
  781.     }
  782.     public function setFutureStock(?FutureStock $futureStock): ProductAttribute
  783.     {
  784.         $this->futureStock $futureStock;
  785.         return $this;
  786.     }
  787. }