Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

100 lines
1.9KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Doctrine\Extension;
  3. use Lc\CaracoleBundle\Model\Config\TaxRateInterface;
  4. use Lc\CaracoleBundle\Model\Config\UnitInterface;
  5. trait PriceTrait
  6. {
  7. /**
  8. * @ORM\Column(type="float", nullable=true)
  9. */
  10. protected $price;
  11. /**
  12. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Config\UnitInterface")
  13. * @ORM\JoinColumn(nullable=true)
  14. */
  15. protected $unit;
  16. /**
  17. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Config\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(): ?UnitInterface
  30. {
  31. return $this->getUnit();
  32. }
  33. public function getTaxRateInherited(): ?TaxRateInterface
  34. {
  35. return $this->getTaxRate();
  36. }
  37. public function getBuyingPriceInherited(): ?float
  38. {
  39. return $this->getBuyingPrice();
  40. }
  41. public function getBuyingPrice(): ?float
  42. {
  43. return $this->buyingPrice;
  44. }
  45. public function setBuyingPrice(?float $buyingPrice): self
  46. {
  47. $this->buyingPrice = $buyingPrice;
  48. return $this;
  49. }
  50. public function getPrice(): ?float
  51. {
  52. return $this->price;
  53. }
  54. public function setPrice(?float $price): self
  55. {
  56. $this->price = $price;
  57. return $this;
  58. }
  59. public function getUnit(): ?UnitInterface
  60. {
  61. return $this->unit;
  62. }
  63. public function setUnit(?UnitInterface $unit): self
  64. {
  65. $this->unit = $unit;
  66. return $this;
  67. }
  68. public function getTaxRate(): ?TaxRateInterface
  69. {
  70. return $this->taxRate;
  71. }
  72. public function setTaxRate(?TaxRateInterface $taxRate): self
  73. {
  74. $this->taxRate = $taxRate;
  75. return $this;
  76. }
  77. }