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ů.

117 lines
2.7KB

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