<?php
namespace App\Entity\System;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* ProductAttribute
*
* @ORM\Table(name="ps_product_attribute")
*
* @ORM\Entity(repositoryClass="App\Repository\System\ProductAttributeRepository")
*/
class ProductAttribute
{
public const PARENT_DEFAULT_ID = 0;
/**
* @var int
*
* @ORM\Column(name="id_product_attribute", type="integer")
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string|null
*
* @ORM\Column(name="ean13", type="string", length=13, nullable=true)
*/
private $ean;
/**
* @var string|null
*
* @ORM\Column(name="ean13_2", type="string", length=13, nullable=true)
*/
private $eanVirtual;
/**
* @var string|null
*
* @ORM\Column(name="reference", type="string", length=32, nullable=true)
*/
private $sku;
/**
* @var bool
*
* @ORM\Column(name="default_on", type="boolean")
*/
private $defaultOn;
/**
* @var int|null
*
* @ORM\Column(name="supplier_reference", type="integer", nullable=true)
*/
private $supplier;
/**
* @var Product
*
* @ORM\ManyToOne(targetEntity="App\Entity\System\Product", inversedBy="productAttributes", cascade={"persist"})
*
* @ORM\JoinColumn(name="id_product", referencedColumnName="id_product")
*/
private $product;
/**
* @var float|null
*
* @ORM\Column(name="height", type="float", nullable=true)
*/
private $height;
/**
* @var float
*
* @ORM\Column(name="weight", type="float")
*/
private $weight;
/**
* @var float|null
*
* @ORM\Column(name="width", type="float", nullable=true)
*/
private $width;
/**
* @var float|null
*
* @ORM\Column(name="depth", type="float", nullable=true)
*/
private $depth;
/**
* @var float
*
* @ORM\Column(name="price", type="float")
*/
private $price;
/**
* @var float
*
* @ORM\Column(name="wholesale_price", type="float")
*/
private $wholesalePrice;
/**
* @var ProductDate
*
* @ORM\OneToOne(targetEntity="App\Entity\System\ProductDate", mappedBy="productAttribute")
*/
private $productDate;
/**
* @var StockAvailable
*
* @ORM\OneToOne(targetEntity="StockAvailable", mappedBy="productAttribute", cascade={"persist", "remove"})
*/
private $stock;
/**
* @var SpecificPrice[]
*
* @ORM\OneToMany(targetEntity="SpecificPrice", mappedBy="productAttribute", cascade={"persist", "remove"})
*/
private $specificPrices;
/**
* @var float|null
*
* @ORM\Column(name="estimate_cost_price", type="float", nullable=true)
*/
private $estimateCostPrice;
/**
* @var float
*
* @ORM\Column(name="unit_price_impact", type="float")
*/
private $unitPriceImpact;
/**
* @var MinimumOrderQuantity[]
*
* @ORM\OneToMany(targetEntity="MinimumOrderQuantity", mappedBy="productAttribute", cascade={"persist", "remove"})
*/
private $minimumOrderQuantitys;
/**
* @var ArrayCollection|ProductEan[]
*
* @ORM\OneToMany(targetEntity="ProductEan", mappedBy="productAttribute", cascade={"persist"})
*/
private $productEans;
/**
* @var Collection<int, Attribute>|Attribute[]
*
* @ORM\ManyToMany(targetEntity="App\Entity\System\Attribute")
*
* @ORM\JoinTable(
* name="ps_product_attribute_combination",
* joinColumns={@ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute", fieldName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="id_attribute", referencedColumnName="id_attribute", fieldName="id")}
* )
*/
private Collection $attributes;
/**
* @ORM\Column(name="buybox", type="boolean")
*/
private bool $buyBox;
/**
* @var float
*
* @ORM\Column(name="wholesale_price_old", type="float")
*/
private $wholesalePriceOld;
/**
* @var float
*
* @ORM\Column(name="unit_price_impact_old", type="float")
*/
private $unitPriceImpactOld;
/**
* @ORM\Column(type="string", length=128)
*/
private ?string $partNumber = null;
/**
* * @ORM\Column(type="float")
*/
private ?float $canon = null;
/**
* ProductAttribute constructor.
*/
public function __construct()
{
$this->minimumOrderQuantitys = new ArrayCollection();
$this->specificPrices = new ArrayCollection();
$this->productEans = new ArrayCollection();
$this->attributes = new ArrayCollection();
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return string|null
*/
public function getEan(): ?string
{
return $this->ean;
}
/**
* @param string|null $ean
*
* @return ProductAttribute
*/
public function setEan(?string $ean): ProductAttribute
{
$this->ean = $ean;
return $this;
}
/**
* @return string|null
*/
public function getEanVirtual(): ?string
{
return $this->eanVirtual;
}
/**
* @param string|null $eanVirtual
*
* @return ProductAttribute
*/
public function setEanVirtual(?string $eanVirtual): ProductAttribute
{
$this->eanVirtual = $eanVirtual;
return $this;
}
/**
* @return string|null
*/
public function getSku(): ?string
{
return $this->sku;
}
/**
* @param string|null $sku
*
* @return ProductAttribute
*/
public function setSku(?string $sku): ProductAttribute
{
$this->sku = $sku;
return $this;
}
/**
* @return bool
*/
public function isDefaultOn(): bool
{
return $this->defaultOn;
}
/**
* @param bool $defaultOn
*
* @return ProductAttribute
*/
public function setDefaultOn(bool $defaultOn): ProductAttribute
{
$this->defaultOn = $defaultOn;
return $this;
}
/**
* @return int|null
*/
public function getSupplier(): ?int
{
return $this->supplier;
}
/**
* @param int|null $supplier
*
* @return ProductAttribute
*/
public function setSupplier(?int $supplier): ProductAttribute
{
$this->supplier = $supplier;
return $this;
}
/**
* @return Product
*/
public function getProduct(): Product
{
return $this->product;
}
/**
* @param Product $product
*
* @return ProductAttribute
*/
public function setProduct(Product $product): ProductAttribute
{
$this->product = $product;
return $this;
}
/**
* @return float|null
*/
public function getHeight(): ?float
{
return $this->height;
}
/**
* @param float|null $height
*
* @return ProductAttribute
*/
public function setHeight(?float $height): ProductAttribute
{
$this->height = $height;
return $this;
}
/**
* @return float
*/
public function getWeight(): float
{
return $this->weight;
}
/**
* @param float $weight
*
* @return ProductAttribute
*/
public function setWeight(float $weight): ProductAttribute
{
$this->weight = $weight;
return $this;
}
/**
* @return float|null
*/
public function getWidth(): ?float
{
return $this->width;
}
/**
* @param float|null $width
*
* @return ProductAttribute
*/
public function setWidth(?float $width): ProductAttribute
{
$this->width = $width;
return $this;
}
/**
* @return float|null
*/
public function getDepth(): ?float
{
return $this->depth;
}
/**
* @param float|null $depth
*
* @return ProductAttribute
*/
public function setDepth(?float $depth): ProductAttribute
{
$this->depth = $depth;
return $this;
}
/**
* @return float
*/
public function getPrice(): float
{
return $this->price;
}
/**
* @param float $price
*
* @return ProductAttribute
*/
public function setPrice(float $price): ProductAttribute
{
$this->price = $price;
return $this;
}
/**
* @return float
*/
public function getWholesalePrice(): float
{
return $this->wholesalePrice;
}
/**
* @param float $wholesalePrice
*
* @return ProductAttribute
*/
public function setWholesalePrice(float $wholesalePrice): ProductAttribute
{
$this->wholesalePrice = $wholesalePrice;
return $this;
}
/**
* @return StockAvailable
*/
public function getStock(): StockAvailable
{
return $this->stock;
}
/**
* @param StockAvailable $stock
*
* @return ProductAttribute
*/
public function setStock(StockAvailable $stock): ProductAttribute
{
$this->stock = $stock;
return $this;
}
/**
* @return SpecificPrice[]
*/
public function getSpecificPrices(): array
{
return $this->specificPrices;
}
/**
* @param SpecificPrice[] $specificPrices
*
* @return ProductAttribute
*/
public function setSpecificPrices(array $specificPrices): ProductAttribute
{
$this->specificPrices = $specificPrices;
return $this;
}
/**
* @return float|null
*/
public function getEstimateCostPrice(): ?float
{
return $this->estimateCostPrice;
}
/**
* @param float|null $estimateCostPrice
*
* @return ProductAttribute
*/
public function setEstimateCostPrice(?float $estimateCostPrice): ProductAttribute
{
$this->estimateCostPrice = $estimateCostPrice;
return $this;
}
/**
* @return float
*/
public function getUnitPriceImpact(): float
{
return $this->unitPriceImpact;
}
/**
* @param float $unitPriceImpact
*
* @return ProductAttribute
*/
public function setUnitPriceImpact(float $unitPriceImpact): ProductAttribute
{
$this->unitPriceImpact = $unitPriceImpact;
return $this;
}
/**
* @return MinimumOrderQuantity[]
*/
public function getMinimumOrderQuantitys(): array
{
return $this->minimumOrderQuantitys;
}
/**
* @param MinimumOrderQuantity[] $minimumOrderQuantitys
*
* @return ProductAttribute
*/
public function setMinimumOrderQuantitys(array $minimumOrderQuantitys): ProductAttribute
{
$this->minimumOrderQuantitys = $minimumOrderQuantitys;
return $this;
}
/**
* @return ProductEan[]|ArrayCollection
*/
public function getProductEans()
{
return $this->productEans;
}
/**
* @param ProductEan[]|ArrayCollection $productEans
*
* @return ProductAttribute
*/
public function setProductEans($productEans): ProductAttribute
{
$this->productEans = $productEans;
return $this;
}
/**
* @return ProductDate
*/
public function getProductDate(): ProductDate
{
return $this->productDate;
}
/**
* @param ProductDate $productDate
*
* @return ProductAttribute
*/
public function setProductDate(ProductDate $productDate): ProductAttribute
{
$this->productDate = $productDate;
return $this;
}
public function isBuyBox(): bool
{
return $this->buyBox;
}
public function setBuyBox(bool $buyBox): ProductAttribute
{
$this->buyBox = $buyBox;
return $this;
}
public function getWholesalePriceOld(): float
{
return $this->wholesalePriceOld;
}
public function setWholesalePriceOld(float $wholesalePriceOld): ProductAttribute
{
$this->wholesalePriceOld = $wholesalePriceOld;
return $this;
}
public function getUnitPriceImpactOld(): float
{
return $this->unitPriceImpactOld;
}
public function setUnitPriceImpactOld(float $unitPriceImpactOld): ProductAttribute
{
$this->unitPriceImpactOld = $unitPriceImpactOld;
return $this;
}
public function getPartNumber(): ?string
{
return $this->partNumber;
}
public function setPartNumber(string $partNumber): ProductAttribute
{
$this->partNumber = $partNumber;
return $this;
}
public function getCanon(): ?float
{
return $this->canon;
}
public function setCanon(float $canon): ProductAttribute
{
$this->canon = $canon;
return $this;
}
/**
* @return Collection<int, Attribute>|Attribute[]
*/
public function getAttributes(): Collection
{
return $this->attributes;
}
/**
* @param Collection<int, Attribute>|Attribute[] $attributes
*/
public function setAttributes(Collection $attributes): ProductAttribute
{
$this->attributes = $attributes;
return $this;
}
}