пре 4 година
пре 4 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. /**
  22. * @ORM\Column(type="float", nullable=true)
  23. */
  24. protected $buyingPrice;
  25. public function getPriceInherited(): ?float
  26. {
  27. return $this->getPrice() ;
  28. }
  29. public function getUnitInherited(): ?Unit
  30. {
  31. return $this->getUnit() ;
  32. }
  33. public function getTaxRateInherited(): ?TaxRate
  34. {
  35. return $this->getTaxRate() ;
  36. }
  37. public function getBuyingPrice(): ?float
  38. {
  39. return $this->buyingPrice;
  40. }
  41. public function setBuyingPrice(?float $buyingPrice): self
  42. {
  43. $this->buyingPrice = $buyingPrice;
  44. return $this;
  45. }
  46. public function getPrice(): ?float
  47. {
  48. return $this->price;
  49. }
  50. public function setPrice(?float $price): self
  51. {
  52. $this->price = $price;
  53. return $this;
  54. }
  55. public function getUnit(): ?Unit
  56. {
  57. return $this->unit;
  58. }
  59. public function setUnit(Unit $unit): self
  60. {
  61. $this->unit = $unit;
  62. return $this;
  63. }
  64. public function getTaxRate(): ?TaxRate
  65. {
  66. return $this->taxRate;
  67. }
  68. public function setTaxRate(?TaxRate $taxRate): self
  69. {
  70. $this->taxRate = $taxRate;
  71. return $this;
  72. }
  73. }