<?php
// src/Acme/UserBundle/Entity/User.php
namespace App\Entity;
use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
use App\Model\LangParamRelationInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @Doctrine\ORM\Mapping\Entity
* @Doctrine\ORM\Mapping\Table(name="product_price_draft")
*/
class ProductPriceDraft implements BlameableInterface, TimestampableInterface, LangParamRelationInterface, SoftDeletableInterface {
use BlameableTrait;
use TimestampableTrait;
use SoftDeletableTrait;
const STATUS_ACCEPTED = 'status_accepted';
const STATUS_REJECTED = 'status_rejected';
const STATUS_WAITING = 'status_waiting';
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\Product", inversedBy="productPriceDrafts")
* @Doctrine\ORM\Mapping\JoinColumn(name="product_id", referencedColumnName="id")
*/
private $product;
/**
* Cena polska !
* @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\ProductPrice")
* @Doctrine\ORM\Mapping\JoinColumn(name="parent_product_price_id", referencedColumnName="id")
*/
private $parentProductPrice;
/**
* Cena waluta którą aktualizujemy !
* @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\ProductPrice")
* @Doctrine\ORM\Mapping\JoinColumn(name="related_product_price_id", referencedColumnName="id")
*/
private $relatedProductPrice;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Currency")
*/
private $currency;
/**
* @Doctrine\ORM\Mapping\Column(type="float", nullable=true)
*/
protected $price;
/**
* @Doctrine\ORM\Mapping\Column(type="float", nullable=true)
*/
protected $discount;
/**
* @Doctrine\ORM\Mapping\Column(name="old_price", type="decimal", precision=10, scale=2, nullable=true)
*/
protected $oldPrice;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Language")
* @ORM\JoinColumn(name="language", referencedColumnName="id")
*/
protected $language;
/**
* @var string
*
* @ORM\Column(name="automatic_price_comment", type="string", length=255, nullable=true)
*/
private $automaticPriceComment;
/**
* @Doctrine\ORM\Mapping\Column(type="float", nullable=true)
*/
protected $automaticPriceDiscount;
/**
* @var string
*
* @ORM\Column(name="status", type="string", length=255, nullable=true)
*/
private $status;
public function getId(): ?int
{
return $this->id;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): self
{
$this->price = $price;
return $this;
}
public function getDiscount(): ?float
{
return $this->discount;
}
public function setDiscount(?float $discount): self
{
$this->discount = $discount;
return $this;
}
public function getOldPrice(): ?string
{
return $this->oldPrice;
}
public function setOldPrice(?string $oldPrice): self
{
$this->oldPrice = $oldPrice;
return $this;
}
public function getAutomaticPriceComment(): ?string
{
return $this->automaticPriceComment;
}
public function setAutomaticPriceComment(?string $automaticPriceComment): self
{
$this->automaticPriceComment = $automaticPriceComment;
return $this;
}
public function getAutomaticPriceDiscount(): ?float
{
return $this->automaticPriceDiscount;
}
public function setAutomaticPriceDiscount(?float $automaticPriceDiscount): self
{
$this->automaticPriceDiscount = $automaticPriceDiscount;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getParentProductPrice(): ?ProductPrice
{
return $this->parentProductPrice;
}
public function setParentProductPrice(?ProductPrice $parentProductPrice): self
{
$this->parentProductPrice = $parentProductPrice;
return $this;
}
public function getCurrency(): ?Currency
{
return $this->currency;
}
public function setCurrency(?Currency $currency): self
{
$this->currency = $currency;
return $this;
}
public function getLanguage(): ?Language
{
return $this->language;
}
public function setLanguage(?Language $language): self
{
$this->language = $language;
return $this;
}
public function getRelatedProductPrice(): ?ProductPrice
{
return $this->relatedProductPrice;
}
public function setRelatedProductPrice(?ProductPrice $relatedProductPrice): self
{
$this->relatedProductPrice = $relatedProductPrice;
return $this;
}
}