148 lines
3.2KB

  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\ShopBundle\Context\OrderPaymentInterface;
  5. use Lc\ShopBundle\Context\ReductionInterface;
  6. /**
  7. * @ORM\MappedSuperclass()
  8. */
  9. trait OrderPayoffTrait
  10. {
  11. /**
  12. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", inversedBy="orderPayments")
  13. * @ORM\JoinColumn(nullable=false)
  14. */
  15. protected $orderShop;
  16. /**
  17. * @ORM\Column(type="string", length=255, nullable=true)
  18. */
  19. protected $meanPayment;
  20. /**
  21. * @ORM\Column(type="text", nullable=true)
  22. */
  23. protected $reference;
  24. /**
  25. * @ORM\Column(type="datetime", nullable=true)
  26. */
  27. protected $paidAt;
  28. /**
  29. * @ORM\Column(type="float")
  30. */
  31. protected $amount;
  32. /**
  33. * @ORM\Column(type="text", nullable=true)
  34. */
  35. protected $comment;
  36. /**
  37. * @ORM\Column(type="boolean")
  38. */
  39. protected $editable;
  40. public function __toString()
  41. {
  42. return $this->amount. '€ par '.$this->type.' le '.$this->getPaidAt()->format('d-m-Y');
  43. }
  44. public function getOrderShop(): ?OrderShop
  45. {
  46. return $this->orderShop;
  47. }
  48. public function setOrderShop(?OrderShop $orderShop): self
  49. {
  50. $this->orderShop = $orderShop;
  51. return $this;
  52. }
  53. public function setMeanPayment(?string $meanPayment): self
  54. {
  55. $this->meanPayment = $meanPayment;
  56. return $this;
  57. }
  58. public function getMeanPayment(?string $meanPayment): self
  59. {
  60. $this->meanPayment = $meanPayment;
  61. return $this;
  62. }
  63. public function getReference(): ?string
  64. {
  65. return $this->reference;
  66. }
  67. public function setReference(?string $reference): self
  68. {
  69. $this->reference = $reference;
  70. return $this;
  71. }
  72. public function getPaidAt(): ?\DateTimeInterface
  73. {
  74. return $this->paidAt;
  75. }
  76. public function setPaidAt(?\DateTimeInterface $paidAt): self
  77. {
  78. $this->paidAt = $paidAt;
  79. return $this;
  80. }
  81. public function getAmount(): ?float
  82. {
  83. return $this->amount;
  84. }
  85. public function setAmount(float $amount): self
  86. {
  87. $this->amount = $amount;
  88. return $this;
  89. }
  90. public function getComment(): ?string
  91. {
  92. return $this->comment;
  93. }
  94. public function setComment(?string $comment): self
  95. {
  96. $this->comment = $comment;
  97. return $this;
  98. }
  99. public function setEditable(bool $editable): self
  100. {
  101. $this->editable = $editable;
  102. return $this;
  103. }
  104. public function getEditable(): ?bool
  105. {
  106. return $this->editable;
  107. }
  108. public function isEditable(): ?bool
  109. {
  110. return $this->editable;
  111. }
  112. }