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