<?php
namespace App\Entity\System;
use Doctrine\ORM\Mapping as ORM;
/**
* SpecificPrice
*
* @ORM\Table(name="ps_specific_price", indexes={
*
* @ORM\Index(name="from_quantity", columns={"from_quantity"}),
* @ORM\Index(name="id_product__from_quantity__id_product_attribute", columns={"id_product", "from_quantity", "id_product_attribute"}),
* })
*
* @ORM\Entity(repositoryClass="App\Repository\System\SpecificPriceRepository")
*/
class SpecificPrice
{
public const DEFAULT_QUANTITY = 1;
/**
* @var int
*
* @ORM\Column(name="id_specific_price", type="integer")
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var Product
*
* @ORM\ManyToOne(targetEntity="Product", inversedBy="specificPrices")
*
* @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=false)
*/
private $product;
/**
* @var ProductAttribute
*
* @ORM\ManyToOne(targetEntity="ProductAttribute", inversedBy="specificPrices")
*
* @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute")
*/
private $productAttribute;
/**
* @var float
*
* @ORM\Column(name="reduction", type="float")
*/
private $reduction;
/**
* @ORM\Column(name="reduction_old", type="float")
*/
private float $reductionOld;
/**
* @var int
*
* @ORM\Column(name="from_quantity", type="integer")
*/
private $fromQuantity;
/**
* @deprecated
*
* @var \DateTime
*
* @ORM\Column(name="`from`", type="datetime", nullable=true)
*/
private $from;
/**
* @deprecated
*
* @var \DateTime
*
* @ORM\Column(name="`to`", type="datetime", nullable=true)
*/
private $to;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $idShop;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $idCurrency;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $idCountry;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $idGroup;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $idCustomer;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $idShopGroup;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $idCart;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $idSpecificPriceRule;
/**
* @deprecated
*
* @var int
*
* @ORM\Column(type="integer", nullable=true)
*/
private $price;
/**
* @deprecated
*
* @var float
*
* @ORM\Column(type="float", nullable=true)
*/
private $reductionWhosalePrice;
/**
* @deprecated
*
* @var string
*
* @ORM\Column(type="string", columnDefinition="enum('amount', 'percentage')", nullable=false)
*/
private $reductionType;
public function __construct()
{
$this->reduction = 0.0;
$this->reductionOld = 0.0;
$this->reductionType = 'amount';
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
public function getProduct(): Product
{
return $this->product;
}
/**
* @param Product $product
*
* @return SpecificPrice
*/
public function setProduct(Product $product): SpecificPrice
{
$this->product = $product;
return $this;
}
/**
* @return ProductAttribute
*/
public function getProductAttribute(): ProductAttribute
{
return $this->productAttribute;
}
/**
* @param ProductAttribute $productAttribute
*
* @return SpecificPrice
*/
public function setProductAttribute(ProductAttribute $productAttribute): SpecificPrice
{
$this->productAttribute = $productAttribute;
return $this;
}
/**
* @return float
*/
public function getReduction(): float
{
return $this->reduction;
}
/**
* @param float $reduction
*
* @return SpecificPrice
*/
public function setReduction(float $reduction): SpecificPrice
{
$this->reduction = $reduction;
return $this;
}
/**
* @return float
*/
public function getReductionOld(): float
{
return $this->reductionOld;
}
/**
* @param float $reductionOld
*
* @return SpecificPrice
*/
public function setReductionOld(float $reductionOld): SpecificPrice
{
$this->reductionOld = $reductionOld;
return $this;
}
/**
* @return int
*/
public function getFromQuantity(): int
{
return $this->fromQuantity;
}
/**
* @param int $fromQuantity
*
* @return SpecificPrice
*/
public function setFromQuantity(int $fromQuantity): SpecificPrice
{
$this->fromQuantity = $fromQuantity;
return $this;
}
public function getFrom(): \DateTime
{
return $this->from;
}
public function setFrom(\DateTime $from): SpecificPrice
{
$this->from = $from;
return $this;
}
public function getTo(): \DateTime
{
return $this->to;
}
public function setTo(\DateTime $to): SpecificPrice
{
$this->to = $to;
return $this;
}
public function getIdShop(): int
{
return $this->idShop;
}
public function setIdShop(int $idShop): SpecificPrice
{
$this->idShop = $idShop;
return $this;
}
public function getIdCurrency(): int
{
return $this->idCurrency;
}
public function setIdCurrency(int $idCurrency): SpecificPrice
{
$this->idCurrency = $idCurrency;
return $this;
}
public function getIdCountry(): int
{
return $this->idCountry;
}
public function setIdCountry(int $idCountry): SpecificPrice
{
$this->idCountry = $idCountry;
return $this;
}
public function getIdGroup(): int
{
return $this->idGroup;
}
public function setIdGroup(int $idGroup): SpecificPrice
{
$this->idGroup = $idGroup;
return $this;
}
public function getIdCustomer(): int
{
return $this->idCustomer;
}
public function setIdCustomer(int $idCustomer): SpecificPrice
{
$this->idCustomer = $idCustomer;
return $this;
}
public function getIdShopGroup(): int
{
return $this->idShopGroup;
}
public function setIdShopGroup(int $idShopGroup): SpecificPrice
{
$this->idShopGroup = $idShopGroup;
return $this;
}
public function getIdCart(): int
{
return $this->idCart;
}
public function setIdCart(int $idCart): SpecificPrice
{
$this->idCart = $idCart;
return $this;
}
public function getIdSpecificPriceRule(): int
{
return $this->idSpecificPriceRule;
}
public function setIdSpecificPriceRule(int $idSpecificPriceRule): SpecificPrice
{
$this->idSpecificPriceRule = $idSpecificPriceRule;
return $this;
}
public function getPrice(): int
{
return $this->price;
}
public function setPrice(int $price): SpecificPrice
{
$this->price = $price;
return $this;
}
public function getReductionWhosalePrice(): float
{
return $this->reductionWhosalePrice;
}
public function setReductionWhosalePrice(float $reductionWhosalePrice): SpecificPrice
{
$this->reductionWhosalePrice = $reductionWhosalePrice;
return $this;
}
public function getReductionType(): string
{
return $this->reductionType;
}
public function setReductionType(string $reductionType): SpecificPrice
{
$this->reductionType = $reductionType;
return $this;
}
}