<?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",
* uniqueConstraints={
*
* @ORM\UniqueConstraint(name="reference_unique", columns={"reference"})
* },
* indexes={
*
* @ORM\Index(name="product_default", columns={"id_product", "default_on"}),
* @ORM\Index(name="id_product_id_product_attribute", columns={"id_product", "id_product_attribute"}),
* @ORM\Index(name="position", columns={"position"}),
* @ORM\Index(name="supplier_reference", columns={"supplier_reference"})
* }
* )
*
* @ORM\Entity(repositoryClass="App\Repository\System\ProductAttributeRepository")
*/
class ProductAttribute
{
public const CM_SUFFIX = '_CM';
public const MP_SUFFIX = '_MP';
/**
* @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", options={"default" : 0})
*/
private $defaultOn;
/**
* @var string|null
*
* @ORM\Column(name="supplier_reference", type="string", length=32, 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", nullable=false)
*/
private $product;
/**
* @var Collection<int, IncomingStock>
*
* @ORM\OneToMany(targetEntity="App\Entity\System\IncomingStock", mappedBy="productAttribute")
*/
private $incommingStocks;
/**
* @var ProductPrice|null
*
* @ORM\OneToOne(targetEntity="ProductPrice", mappedBy="productAttribute", cascade={"persist"})
*/
private $productPrice;
/**
* @var float
*
* @ORM\Column(name="height", type="float", nullable=false, options={"default" : 0})
*/
private float $height;
/**
* @ORM\Column(name="weight", type="float", nullable=false, options={"default" : 0})
*/
private float $weight;
/**
* @ORM\Column(name="width", type="float", nullable=false, options={"default" : 0})
*/
private float $width;
/**
* @ORM\Column(name="depth", type="float", nullable=false, options={"default" : 0})
*/
private float $depth;
/**
* @var int
*
* @ORM\Column(name="palet", type="integer", options={"default" : 0})
*/
private $palletUnits;
/**
* @var int
*
* @ORM\Column(name="position", type="integer", options={"default" : 1})
*/
private $position;
/**
* @var int
*
* @ORM\Column(name="box", type="integer", options={"default" : 0})
*/
private $boxUnits;
/**
* @ORM\Column(type="string", length=1)
*/
private string $logisticClass;
/**
* @var ProductDate|null
*
* @ORM\OneToOne(targetEntity="App\Entity\System\ProductDate", mappedBy="productAttribute")
*/
private $productDate;
/**
* @var StockAvailable|null
*
* @ORM\OneToOne(targetEntity="StockAvailable", mappedBy="productAttribute", cascade={"persist", "remove"})
*/
private $stock;
/**
* @var Collection<int, FutureStock>&iterable<FutureStock>
*
* @ORM\OneToMany(targetEntity="FutureStock", mappedBy="productAttribute", cascade={"persist", "remove"})
*/
private $futureStocks;
/**
* @var Collection<int, MinimumOrderQuantity>
*
* @ORM\OneToMany(targetEntity="MinimumOrderQuantity", mappedBy="productAttribute", cascade={"persist", "remove"})
*/
private $minimumOrderQuantitys;
/**
* @var Collection<int, 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", options={"default" : 0})
*/
private bool $buyBox;
/**
* @ORM\Column(type="string", length=128, nullable=true)
*/
private ?string $partNumber = null;
/**
* * @ORM\Column(type="float", nullable=true)
*/
private ?float $canon = null;
/**
* @deprecated
*
* @ORM\Column(type="string", length=64, nullable=true)
*/
private ?string $location = null;
/**
* @deprecated
*
* @ORM\Column(type="string", length=12, nullable=true)
*/
private ?string $upc = null;
/**
* @deprecated
*
* @ORM\Column(type="float", nullable=true, options={"default" : 0})
*/
private ?float $ecotax = null;
/**
* @deprecated
*
* @ORM\Column(type="integer", nullable=true, options={"default" : 0})
*/
private ?int $quantity = null;
/**
* @deprecated
*
* @ORM\Column(type="integer", nullable=true, options={"default" : 1})
*/
private ?int $minimalQuantity = null;
/**
* @deprecated
*
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTime $availableDate = null;
/**
* @deprecated
*
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $picking = null;
/**
* @deprecated
*
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $locationPalet1 = null;
/**
* @deprecated
*
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $locationPalet2 = null;
/**
* @deprecated
*
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTime $dateAdd = null;
/**
* @deprecated
*
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTime $dateUpd = null;
/**
* @deprecated
*
* @ORM\Column(type="integer", nullable=true, options={"default" : 0})
*/
private ?int $container_20p = null;
/**
* @deprecated
*
* @ORM\Column(type="integer", nullable=true, options={"default" : 0})
*/
private ?int $container_40p = null;
/**
* @deprecated
*
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTime $dateNext = null;
/**
* @deprecated
*
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $delay = null;
/**
* @deprecated
*
* @ORM\Column(type="integer", nullable=true)
*/
private ?int $idProductAttributeCompras = null;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTime $dateDisabled = null;
/**
* ProductAttribute constructor.
*/
public function __construct()
{
$this->minimumOrderQuantitys = new ArrayCollection();
$this->attributes = new ArrayCollection();
$this->buyBox = false;
}
public function getId(): int
{
return $this->id;
}
public function setId(int $id): ProductAttribute
{
$this->id = $id;
return $this;
}
public function getEan(): ?string
{
return $this->ean;
}
public function setEan(?string $ean): ProductAttribute
{
$this->ean = $ean;
return $this;
}
public function getEanVirtual(): ?string
{
return $this->eanVirtual;
}
public function setEanVirtual(?string $eanVirtual): ProductAttribute
{
$this->eanVirtual = $eanVirtual;
return $this;
}
public function getSku(): ?string
{
return $this->sku;
}
public function setSku(?string $sku): ProductAttribute
{
$this->sku = $sku;
return $this;
}
public function isDefaultOn(): bool
{
return $this->defaultOn;
}
public function setDefaultOn(bool $defaultOn): ProductAttribute
{
$this->defaultOn = $defaultOn;
return $this;
}
public function getSupplier(): ?string
{
return $this->supplier;
}
public function setSupplier(?string $supplier): ProductAttribute
{
$this->supplier = $supplier;
return $this;
}
public function getProduct(): Product
{
return $this->product;
}
public function setProduct(Product $product): ProductAttribute
{
$this->product = $product;
return $this;
}
public function getHeight(): float
{
return $this->height;
}
public function setHeight(float $height): ProductAttribute
{
$this->height = $height;
return $this;
}
public function getWeight(): float
{
return $this->weight;
}
public function setWeight(float $weight): ProductAttribute
{
$this->weight = $weight;
return $this;
}
public function getWidth(): float
{
return $this->width;
}
public function setWidth(float $width): ProductAttribute
{
$this->width = $width;
return $this;
}
public function getDepth(): float
{
return $this->depth;
}
public function setDepth(float $depth): ProductAttribute
{
$this->depth = $depth;
return $this;
}
public function getPalletUnits(): int
{
return $this->palletUnits;
}
public function setPalletUnits(int $palletUnits): ProductAttribute
{
$this->palletUnits = $palletUnits;
return $this;
}
public function getPosition(): int
{
return $this->position;
}
public function setPosition(int $position): ProductAttribute
{
$this->position = $position;
return $this;
}
public function getBoxUnits(): int
{
return $this->boxUnits;
}
public function setBoxUnits(int $boxUnits): ProductAttribute
{
$this->boxUnits = $boxUnits;
return $this;
}
public function getLogisticClass(): string
{
return $this->logisticClass;
}
public function setLogisticClass(string $logisticClass): ProductAttribute
{
$this->logisticClass = $logisticClass;
return $this;
}
public function getStock(): ?StockAvailable
{
return $this->stock;
}
public function setStock(StockAvailable $stock): ProductAttribute
{
$this->stock = $stock;
return $this;
}
/**
* @return Collection<int, MinimumOrderQuantity>
*/
public function getMinimumOrderQuantitys(): Collection
{
return $this->minimumOrderQuantitys;
}
/**
* @param Collection<int, MinimumOrderQuantity> $minimumOrderQuantitys
*
* @return ProductAttribute
*/
public function setMinimumOrderQuantitys(Collection $minimumOrderQuantitys): ProductAttribute
{
$this->minimumOrderQuantitys = $minimumOrderQuantitys;
return $this;
}
public function getProductDate(): ProductDate
{
return $this->productDate;
}
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 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>
*/
public function getAttributes(): Collection
{
return $this->attributes;
}
/**
* @param Collection<int, Attribute> $attributes
*/
public function setAttributes(Collection $attributes): ProductAttribute
{
$this->attributes = $attributes;
return $this;
}
/**
* @return Collection<int, FutureStock>&iterable<FutureStock>
*/
public function getFutureStocks()
{
return $this->futureStocks;
}
/**
* @param Collection<int, FutureStock>&iterable<FutureStock> $futureStocks
*/
public function setFutureStocks($futureStocks): ProductAttribute
{
$this->futureStocks = $futureStocks;
return $this;
}
public function getDateDisabled(): ?\DateTime
{
return $this->dateDisabled;
}
public function setDateDisabled(?\DateTime $dateDisabled): ProductAttribute
{
$this->dateDisabled = $dateDisabled;
return $this;
}
/**
* @return Collection<int, IncomingStock>
*/
public function getIncommingStocks()
{
return $this->incommingStocks;
}
/**
* @param Collection<int, IncomingStock> $incommingStocks
*/
public function setIncommingStocks(Collection $incommingStocks): ProductAttribute
{
$this->incommingStocks = $incommingStocks;
return $this;
}
public function getProductPrice(): ?ProductPrice
{
return $this->productPrice;
}
public function setProductPrice(ProductPrice $productPrice): ProductAttribute
{
$this->productPrice = $productPrice;
return $this;
}
}