Browse Source

Modèles CreditHistory / UserMerchant

feature/export_comptable
Guillaume 4 years ago
parent
commit
c417ff0d9f
1 changed files with 43 additions and 3 deletions
  1. +43
    -3
      ShopBundle/Model/CreditHistory.php

+ 43
- 3
ShopBundle/Model/CreditHistory.php View File

@@ -2,8 +2,13 @@

namespace Lc\ShopBundle\Model;

use App\Entity\OrderPayment;
use App\Entity\OrderRefund;
use App\Entity\UserMerchant;
use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\OrderPaymentInterface;
use Lc\ShopBundle\Context\OrderRefundInterface;
use Lc\ShopBundle\Context\UserMerchantInterface;

/**
* @ORM\MappedSuperclass()
@@ -26,11 +31,22 @@ abstract class CreditHistory extends AbstractEntity
protected $comment;

/**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserLerchantInterface", inversedBy="creditHistories")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserMerchantInterface", inversedBy="creditHistories")
* @ORM\JoinColumn(nullable=false)
*/
protected $userMerchant;

/**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderPaymentInterface", cascade={"persist", "remove"})
*/
protected $orderPayment;

/**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderRefundInterface", cascade={"persist", "remove"})
*/
protected $orderRefund;


public function getAmount(): ?float
{
return $this->amount;
@@ -67,15 +83,39 @@ abstract class CreditHistory extends AbstractEntity
return $this;
}

public function getUserMerchant(): ?UserMerchant
public function getUserMerchant(): ?UserMerchantInterface
{
return $this->userMerchant;
}

public function setUserMerchant(?UserMerchant $userMerchant): self
public function setUserMerchant(?UserMerchantInterface $userMerchant): self
{
$this->userMerchant = $userMerchant;

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;
}
}

Loading…
Cancel
Save