|
- <?php
-
- namespace Lc\CaracoleBundle\Model\Credit;
-
- use Doctrine\ORM\Mapping as ORM;
- use Lc\CaracoleBundle\Doctrine\Extension\PayoffTrait;
- use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
- use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
- use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
- use Lc\CaracoleBundle\Doctrine\Extension\PayoffInterface;
- use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait;
- use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class CreditHistoryModel extends AbstractLightEntity implements PayoffInterface, CreditHistoryInterface
- {
- use PayoffTrait;
-
- const TYPE_CREDIT = 'credit';
- const TYPE_DEBIT = 'debit';
-
- /**
- * @ORM\Column(type="float", nullable=true)
- */
- protected $amount;
-
- /**
- * @ORM\Column(type="string", length=31)
- */
- protected $type;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserMerchantInterface", inversedBy="creditHistories")
- * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
- */
- protected $userMerchant;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $merchant;
-
- /**
- * @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderPaymentInterface", cascade={"persist"})
- */
- protected $orderPayment;
-
- /**
- * @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderRefundInterface", cascade={"persist"})
- */
- protected $orderRefund;
-
- public function __toString()
- {
- //Todo a écrire
- return $this->getType();
- }
-
- public function getAmount(): ?float
- {
- return $this->amount;
- }
-
- public function setAmount(?float $amount): self
- {
- $this->amount = $amount;
-
- return $this;
- }
-
- public function getType(): ?string
- {
- return $this->type;
- }
-
- public function setType(string $type): self
- {
- $this->type = $type;
-
- return $this;
- }
-
- public function getUserMerchant(): ?UserMerchantInterface
- {
- return $this->userMerchant;
- }
-
- public function setUserMerchant(?UserMerchantInterface $userMerchant): self
- {
- $this->userMerchant = $userMerchant;
-
- return $this;
- }
- public function getMerchant(): MerchantInterface
- {
- return $this->merchant;
- }
-
- public function setMerchant(MerchantInterface $merchant): self
- {
- $this->merchant = $merchant;
-
- return $this;
- }
-
- public function getOrderPayment(): ?OrderPaymentInterface
- {
- return $this->orderPayment;
- }
-
- public function setOrderPayment(?OrderPaymentInterface $orderPayment): self
- {
- $this->orderPayment = $orderPayment;
-
- return $this;
- }
-
- public function getOrderRefund(): ?OrderRefundInterface
- {
- return $this->orderRefund;
- }
-
- public function setOrderRefund(?OrderRefundInterface $orderRefund): self
- {
- $this->orderRefund = $orderRefund;
-
- return $this;
- }
- }
|