PriceTrait.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace Lc\ShopBundle\Model ;
  3. use Lc\ShopBundle\Context\ReductionCatalogInterface;
  4. use Lc\ShopBundle\Context\UnitInterface;
  5. trait PriceTrait
  6. {
  7. /**
  8. * @ORM\Column(type="float", nullable=true)
  9. */
  10. protected $price;
  11. /**
  12. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UnitInterface")
  13. * @ORM\JoinColumn(nullable=true)
  14. */
  15. protected $unit;
  16. /**
  17. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\TaxRateInterface")
  18. * @ORM\JoinColumn(nullable=true)
  19. */
  20. protected $taxRate;
  21. public function getPriceInherited(): ?float
  22. {
  23. return $this->getPrice() ;
  24. }
  25. public function getUnitInherited(): ?Unit
  26. {
  27. return $this->getUnit() ;
  28. }
  29. public function getTaxRateInherited(): ?TaxRate
  30. {
  31. return $this->getTaxRate() ;
  32. }
  33. public function getPrice(): ?float
  34. {
  35. return $this->price;
  36. }
  37. public function setPrice(?float $price): self
  38. {
  39. $this->price = $price;
  40. return $this;
  41. }
  42. public function getUnit(): ?Unit
  43. {
  44. return $this->unit;
  45. }
  46. public function setUnit(Unit $unit): self
  47. {
  48. $this->unit = $unit;
  49. return $this;
  50. }
  51. public function getTaxRate(): ?TaxRate
  52. {
  53. return $this->taxRate;
  54. }
  55. public function setTaxRate(?TaxRate $taxRate): self
  56. {
  57. $this->taxRate = $taxRate;
  58. return $this;
  59. }
  60. }