src/Entity/ProductPriceDraft.php line 30

Open in your IDE?
  1. <?php
  2. // src/Acme/UserBundle/Entity/User.php
  3. namespace App\Entity;
  4. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  5. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  6. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  7. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  8. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  9. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  10. use App\Model\LangParamRelationInterface;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\Common\Collections\Collection;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  16. /**
  17.  * @Doctrine\ORM\Mapping\Entity
  18.  * @Doctrine\ORM\Mapping\Table(name="product_price_draft")
  19.  */
  20. class ProductPriceDraft implements BlameableInterfaceTimestampableInterfaceLangParamRelationInterfaceSoftDeletableInterface  {
  21.     use BlameableTrait;
  22.     use TimestampableTrait;
  23.     
  24.     use SoftDeletableTrait;
  25.     
  26. const STATUS_ACCEPTED 'status_accepted';
  27.     const STATUS_REJECTED 'status_rejected';
  28.     const STATUS_WAITING 'status_waiting';
  29.     /**
  30.      * @var integer
  31.      *
  32.      * @ORM\Column(name="id", type="integer", nullable=false)
  33.      * @ORM\Id
  34.      * @ORM\GeneratedValue(strategy="IDENTITY")
  35.      */
  36.     private $id;
  37.     /**
  38.      * @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\Product", inversedBy="productPriceDrafts")
  39.      * @Doctrine\ORM\Mapping\JoinColumn(name="product_id", referencedColumnName="id")
  40.      */
  41.     private $product;
  42.     /**
  43.      * Cena polska !
  44.      * @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\ProductPrice")
  45.      * @Doctrine\ORM\Mapping\JoinColumn(name="parent_product_price_id", referencedColumnName="id")
  46.      */
  47.     private $parentProductPrice;
  48.     /**
  49.      * Cena waluta którą aktualizujemy !
  50.      * @Doctrine\ORM\Mapping\ManyToOne(targetEntity="App\Entity\ProductPrice")
  51.      * @Doctrine\ORM\Mapping\JoinColumn(name="related_product_price_id", referencedColumnName="id")
  52.      */
  53.     private $relatedProductPrice;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity="App\Entity\Currency")
  56.      */
  57.     private $currency;
  58.     /**
  59.      * @Doctrine\ORM\Mapping\Column(type="float", nullable=true)
  60.      */
  61.     protected $price;
  62.     /**
  63.      * @Doctrine\ORM\Mapping\Column(type="float", nullable=true)
  64.      */
  65.     protected $discount;
  66.     /**
  67.      * @Doctrine\ORM\Mapping\Column(name="old_price", type="decimal", precision=10, scale=2, nullable=true)
  68.      */
  69.     protected $oldPrice;
  70.     /**
  71.      * @ORM\ManyToOne(targetEntity="App\Entity\Language")
  72.      * @ORM\JoinColumn(name="language", referencedColumnName="id")
  73.      */
  74.     protected $language;
  75.     /**
  76.      * @var string
  77.      *
  78.      * @ORM\Column(name="automatic_price_comment", type="string", length=255, nullable=true)
  79.      */
  80.     private $automaticPriceComment;
  81.     /**
  82.      * @Doctrine\ORM\Mapping\Column(type="float", nullable=true)
  83.      */
  84.     protected $automaticPriceDiscount;
  85.     /**
  86.      * @var string
  87.      *
  88.      * @ORM\Column(name="status", type="string", length=255, nullable=true)
  89.      */
  90.     private $status;
  91.     public function getId(): ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     public function getPrice(): ?float
  96.     {
  97.         return $this->price;
  98.     }
  99.     public function setPrice(?float $price): self
  100.     {
  101.         $this->price $price;
  102.         return $this;
  103.     }
  104.     public function getDiscount(): ?float
  105.     {
  106.         return $this->discount;
  107.     }
  108.     public function setDiscount(?float $discount): self
  109.     {
  110.         $this->discount $discount;
  111.         return $this;
  112.     }
  113.     public function getOldPrice(): ?string
  114.     {
  115.         return $this->oldPrice;
  116.     }
  117.     public function setOldPrice(?string $oldPrice): self
  118.     {
  119.         $this->oldPrice $oldPrice;
  120.         return $this;
  121.     }
  122.     public function getAutomaticPriceComment(): ?string
  123.     {
  124.         return $this->automaticPriceComment;
  125.     }
  126.     public function setAutomaticPriceComment(?string $automaticPriceComment): self
  127.     {
  128.         $this->automaticPriceComment $automaticPriceComment;
  129.         return $this;
  130.     }
  131.     public function getAutomaticPriceDiscount(): ?float
  132.     {
  133.         return $this->automaticPriceDiscount;
  134.     }
  135.     public function setAutomaticPriceDiscount(?float $automaticPriceDiscount): self
  136.     {
  137.         $this->automaticPriceDiscount $automaticPriceDiscount;
  138.         return $this;
  139.     }
  140.     public function getStatus(): ?string
  141.     {
  142.         return $this->status;
  143.     }
  144.     public function setStatus(?string $status): self
  145.     {
  146.         $this->status $status;
  147.         return $this;
  148.     }
  149.     public function getProduct(): ?Product
  150.     {
  151.         return $this->product;
  152.     }
  153.     public function setProduct(?Product $product): self
  154.     {
  155.         $this->product $product;
  156.         return $this;
  157.     }
  158.     public function getParentProductPrice(): ?ProductPrice
  159.     {
  160.         return $this->parentProductPrice;
  161.     }
  162.     public function setParentProductPrice(?ProductPrice $parentProductPrice): self
  163.     {
  164.         $this->parentProductPrice $parentProductPrice;
  165.         return $this;
  166.     }
  167.     public function getCurrency(): ?Currency
  168.     {
  169.         return $this->currency;
  170.     }
  171.     public function setCurrency(?Currency $currency): self
  172.     {
  173.         $this->currency $currency;
  174.         return $this;
  175.     }
  176.     public function getLanguage(): ?Language
  177.     {
  178.         return $this->language;
  179.     }
  180.     public function setLanguage(?Language $language): self
  181.     {
  182.         $this->language $language;
  183.         return $this
  184.     }
  185.     public function getRelatedProductPrice(): ?ProductPrice
  186.     {
  187.         return $this->relatedProductPrice;
  188.     }
  189.     public function setRelatedProductPrice(?ProductPrice $relatedProductPrice): self
  190.     {
  191.         $this->relatedProductPrice $relatedProductPrice;
  192.         return $this;
  193.     }
  194. }