You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
2.9KB

  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use App\Entity\OrderPayment;
  4. use App\Entity\OrderRefund;
  5. use App\Entity\UserMerchant;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Lc\ShopBundle\Context\OrderPaymentInterface;
  8. use Lc\ShopBundle\Context\OrderRefundInterface;
  9. use Lc\ShopBundle\Context\UserMerchantInterface;
  10. /**
  11. * @ORM\MappedSuperclass()
  12. */
  13. abstract class CreditHistory extends AbstractEntity
  14. {
  15. /**
  16. * @ORM\Column(type="float")
  17. */
  18. protected $amount;
  19. /**
  20. * @ORM\Column(type="string", length=31)
  21. */
  22. protected $meanPayment;
  23. /**
  24. * @ORM\Column(type="text", nullable=true)
  25. */
  26. protected $comment;
  27. /**
  28. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserMerchantInterface", inversedBy="creditHistories")
  29. * @ORM\JoinColumn(nullable=false)
  30. */
  31. protected $userMerchant;
  32. /**
  33. * @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderPaymentInterface", cascade={"persist", "remove"})
  34. */
  35. protected $orderPayment;
  36. /**
  37. * @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderRefundInterface", cascade={"persist", "remove"})
  38. */
  39. protected $orderRefund;
  40. public function getAmount(): ?float
  41. {
  42. return $this->amount;
  43. }
  44. public function setAmount(float $amount): self
  45. {
  46. $this->amount = $amount;
  47. return $this;
  48. }
  49. public function getMeanPayment(): ?string
  50. {
  51. return $this->meanPayment;
  52. }
  53. public function setMeanPayment(string $meanPayment): self
  54. {
  55. $this->meanPayment = $meanPayment;
  56. return $this;
  57. }
  58. public function getComment(): ?string
  59. {
  60. return $this->comment;
  61. }
  62. public function setComment(string $comment): self
  63. {
  64. $this->comment = $comment;
  65. return $this;
  66. }
  67. public function getUserMerchant(): ?UserMerchantInterface
  68. {
  69. return $this->userMerchant;
  70. }
  71. public function setUserMerchant(?UserMerchantInterface $userMerchant): self
  72. {
  73. $this->userMerchant = $userMerchant;
  74. return $this;
  75. }
  76. public function getOrderPayment(): ?OrderPaymentInterface
  77. {
  78. return $this->orderPayment;
  79. }
  80. public function setOrderPayment(?OrderPaymentInterface $orderPayment): self
  81. {
  82. $this->orderPayment = $orderPayment;
  83. return $this;
  84. }
  85. public function getOrderRefund(): ?OrderRefundInterface
  86. {
  87. return $this->orderRefund;
  88. }
  89. public function setOrderRefund(?OrderRefundInterface $orderRefund): self
  90. {
  91. $this->orderRefund = $orderRefund;
  92. return $this;
  93. }
  94. }