|
|
|
|
|
|
|
|
use Doctrine\Common\Collections\Collection; |
|
|
use Doctrine\Common\Collections\Collection; |
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
use Lc\ShopBundle\Context\CreditHistoryInterface; |
|
|
use Lc\ShopBundle\Context\CreditHistoryInterface; |
|
|
|
|
|
use Lc\ShopBundle\Context\FilterMerchantInterface; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @ORM\MappedSuperclass() |
|
|
* @ORM\MappedSuperclass() |
|
|
* |
|
|
* |
|
|
*/ |
|
|
*/ |
|
|
abstract class UserMerchant |
|
|
|
|
|
|
|
|
abstract class UserMerchant implements FilterMerchantInterface |
|
|
{ |
|
|
{ |
|
|
/** |
|
|
/** |
|
|
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="userMerchants") |
|
|
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="userMerchants") |
|
|
|
|
|
|
|
|
protected $merchant; |
|
|
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) |
|
|
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\CreditHistoryInterface", mappedBy="userMerchant", orphanRemoval=true) |
|
|
|
|
|
|
|
|
return $this; |
|
|
return $this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getMerchant(): ?Hub |
|
|
|
|
|
|
|
|
public function getMerchant(): ?Merchant |
|
|
{ |
|
|
{ |
|
|
return $this->merchant; |
|
|
return $this->merchant; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function setMerchant(?Hub $merchant): self |
|
|
|
|
|
|
|
|
public function setMerchant(?Merchant $merchant): self |
|
|
{ |
|
|
{ |
|
|
$this->merchant = $merchant; |
|
|
$this->merchant = $merchant; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this->credit; |
|
|
return $this->credit; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function setCredit(float $credit): self |
|
|
|
|
|
|
|
|
public function setCredit(?float $credit): self |
|
|
{ |
|
|
{ |
|
|
$this->credit = $credit; |
|
|
$this->credit = $credit; |
|
|
|
|
|
|
|
|
return $this; |
|
|
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[] |
|
|
* @return Collection|CreditHistory[] |
|
|
*/ |
|
|
*/ |