No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

CreditHistoryModel.php 2.7KB

hace 3 años
hace 3 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. }