Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

CreditHistoryModel.php 3.2KB

před 3 roky
před 3 roky
před 2 roky
před 2 roky
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. namespace Lc\CaracoleBundle\Model\Credit;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\CaracoleBundle\Doctrine\Extension\PayoffTrait;
  5. use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
  6. use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
  7. use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
  8. use Lc\CaracoleBundle\Doctrine\Extension\PayoffInterface;
  9. use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait;
  12. use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
  13. /**
  14. * @ORM\MappedSuperclass()
  15. */
  16. abstract class CreditHistoryModel extends AbstractLightEntity implements PayoffInterface, CreditHistoryInterface
  17. {
  18. use PayoffTrait;
  19. const TYPE_CREDIT = 'credit';
  20. const TYPE_DEBIT = 'debit';
  21. /**
  22. * @ORM\Column(type="float", nullable=true)
  23. */
  24. protected $amount;
  25. /**
  26. * @ORM\Column(type="string", length=31)
  27. */
  28. protected $type;
  29. /**
  30. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserMerchantInterface", inversedBy="creditHistories")
  31. * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  32. */
  33. protected $userMerchant;
  34. /**
  35. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
  36. * @ORM\JoinColumn(nullable=false)
  37. */
  38. protected $merchant;
  39. /**
  40. * @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderPaymentInterface", cascade={"persist"})
  41. */
  42. protected $orderPayment;
  43. /**
  44. * @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderRefundInterface", cascade={"persist"})
  45. */
  46. protected $orderRefund;
  47. public function __toString()
  48. {
  49. //Todo a écrire
  50. return $this->getType();
  51. }
  52. public function getAmount(): ?float
  53. {
  54. return $this->amount;
  55. }
  56. public function setAmount(?float $amount): self
  57. {
  58. $this->amount = $amount;
  59. return $this;
  60. }
  61. public function getType(): ?string
  62. {
  63. return $this->type;
  64. }
  65. public function setType(string $type): self
  66. {
  67. $this->type = $type;
  68. return $this;
  69. }
  70. public function getUserMerchant(): ?UserMerchantInterface
  71. {
  72. return $this->userMerchant;
  73. }
  74. public function setUserMerchant(?UserMerchantInterface $userMerchant): self
  75. {
  76. $this->userMerchant = $userMerchant;
  77. return $this;
  78. }
  79. public function getMerchant(): MerchantInterface
  80. {
  81. return $this->merchant;
  82. }
  83. public function setMerchant(MerchantInterface $merchant): self
  84. {
  85. $this->merchant = $merchant;
  86. return $this;
  87. }
  88. public function getOrderPayment(): ?OrderPaymentInterface
  89. {
  90. return $this->orderPayment;
  91. }
  92. public function setOrderPayment(?OrderPaymentInterface $orderPayment): self
  93. {
  94. $this->orderPayment = $orderPayment;
  95. return $this;
  96. }
  97. public function getOrderRefund(): ?OrderRefundInterface
  98. {
  99. return $this->orderRefund;
  100. }
  101. public function setOrderRefund(?OrderRefundInterface $orderRefund): self
  102. {
  103. $this->orderRefund = $orderRefund;
  104. return $this;
  105. }
  106. }