<?php
namespace App\Entity\System;
use Doctrine\ORM\Mapping as ORM;
/**
* SpecificPrice
*
* @ORM\Table(name="ps_specific_price")
*
* @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")
*/
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;
public function __construct()
{
$this->reduction = 0.0;
$this->reductionOld = 0.0;
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Product
*/
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 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 getReductionOld(): float
{
return $this->reductionOld;
}
public function setReductionOld(float $reductionOld): SpecificPrice
{
$this->reductionOld = $reductionOld;
return $this;
}
}