|
- <?php
-
- namespace Lc\CaracoleBundle\Doctrine\Extension;
-
- use Lc\CaracoleBundle\Model\Config\TaxRateInterface;
- use Lc\CaracoleBundle\Model\Config\UnitInterface;
-
- trait PriceTrait
- {
- /**
- * @ORM\Column(type="float", nullable=true)
- */
- protected $price;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Config\UnitInterface")
- * @ORM\JoinColumn(nullable=true)
- */
- protected $unit;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Config\TaxRateInterface")
- * @ORM\JoinColumn(nullable=true)
- */
- protected $taxRate;
-
- /**
- * @ORM\Column(type="float", nullable=true)
- */
- protected $buyingPrice;
-
- public function getPriceInherited(): ?float
- {
- return $this->getPrice();
- }
-
- public function getUnitInherited(): ?UnitInterface
- {
- return $this->getUnit();
- }
-
- public function getTaxRateInherited(): ?TaxRateInterface
- {
- return $this->getTaxRate();
- }
-
- public function getBuyingPriceInherited(): ?float
- {
- return $this->getBuyingPrice();
- }
-
- public function getBuyingPrice(): ?float
- {
- return $this->buyingPrice;
- }
-
- public function setBuyingPrice(?float $buyingPrice): self
- {
- $this->buyingPrice = $buyingPrice;
-
- return $this;
- }
-
- public function getPrice(): ?float
- {
- return $this->price;
- }
-
- public function setPrice(?float $price): self
- {
- $this->price = $price;
-
- return $this;
- }
-
- public function getUnit(): ?UnitInterface
- {
- return $this->unit;
- }
-
- public function setUnit(?UnitInterface $unit): self
- {
- $this->unit = $unit;
-
- return $this;
- }
-
- public function getTaxRate(): ?TaxRateInterface
- {
- return $this->taxRate;
- }
-
- public function setTaxRate(?TaxRateInterface $taxRate): self
- {
- $this->taxRate = $taxRate;
-
- return $this;
- }
- }
|