|
|
@@ -7,12 +7,13 @@ use Doctrine\Common\Collections\ArrayCollection; |
|
|
|
use Doctrine\Common\Collections\Collection; |
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
use Lc\ShopBundle\Context\CreditHistoryInterface; |
|
|
|
use Lc\ShopBundle\Context\FilterMerchantInterface; |
|
|
|
|
|
|
|
/** |
|
|
|
* @ORM\MappedSuperclass() |
|
|
|
* |
|
|
|
*/ |
|
|
|
abstract class UserMerchant |
|
|
|
abstract class UserMerchant implements FilterMerchantInterface |
|
|
|
{ |
|
|
|
/** |
|
|
|
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="userMerchants") |
|
|
@@ -27,9 +28,14 @@ abstract class UserMerchant |
|
|
|
protected $merchant; |
|
|
|
|
|
|
|
/** |
|
|
|
* @ORM\Column(type="float") |
|
|
|
* @ORM\Column(type="float", nullable=true) |
|
|
|
*/ |
|
|
|
protected $credit ; |
|
|
|
protected $credit; |
|
|
|
|
|
|
|
/** |
|
|
|
* @ORM\Column(type="boolean") |
|
|
|
*/ |
|
|
|
protected $creditActive; |
|
|
|
|
|
|
|
/** |
|
|
|
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\CreditHistoryInterface", mappedBy="userMerchant", orphanRemoval=true) |
|
|
@@ -53,12 +59,12 @@ abstract class UserMerchant |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function getMerchant(): ?Hub |
|
|
|
public function getMerchant(): ?Merchant |
|
|
|
{ |
|
|
|
return $this->merchant; |
|
|
|
} |
|
|
|
|
|
|
|
public function setMerchant(?Hub $merchant): self |
|
|
|
public function setMerchant(?Merchant $merchant): self |
|
|
|
{ |
|
|
|
$this->merchant = $merchant; |
|
|
|
|
|
|
@@ -70,13 +76,30 @@ abstract class UserMerchant |
|
|
|
return $this->credit; |
|
|
|
} |
|
|
|
|
|
|
|
public function setCredit(float $credit): self |
|
|
|
public function setCredit(?float $credit): self |
|
|
|
{ |
|
|
|
$this->credit = $credit; |
|
|
|
|
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function getCreditActive(): ?bool |
|
|
|
{ |
|
|
|
return $this->creditActive; |
|
|
|
} |
|
|
|
|
|
|
|
public function isCreditActive(): bool |
|
|
|
{ |
|
|
|
return $this->creditActive; |
|
|
|
} |
|
|
|
|
|
|
|
public function setCreditActive(bool $creditActive): self |
|
|
|
{ |
|
|
|
$this->creditActive = $creditActive; |
|
|
|
|
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|CreditHistory[] |
|
|
|
*/ |