|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use App\Entity\CreditHistory;
- 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;
-
-
- abstract class UserMerchant implements FilterMerchantInterface
- {
-
-
- protected $user;
-
-
-
- protected $merchant;
-
-
-
- protected $credit;
-
-
-
- protected $creditActive;
-
-
-
- protected $creditHistories;
-
- public function __construct()
- {
- $this->creditHistories = new ArrayCollection();
- }
-
- public function getUser(): ?User
- {
- return $this->user;
- }
-
- public function setUser(?User $user): self
- {
- $this->user = $user;
-
- return $this;
- }
-
- public function getMerchant(): ?Merchant
- {
- return $this->merchant;
- }
-
- public function setMerchant(?Merchant $merchant): self
- {
- $this->merchant = $merchant;
-
- return $this;
- }
-
- public function getCredit(): ?float
- {
- return $this->credit;
- }
-
- 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;
- }
-
-
-
- public function getCreditHistories(): Collection
- {
- return $this->creditHistories;
- }
-
- public function addCreditHistory(CreditHistoryInterface $creditHistory): self
- {
- if (!$this->creditHistories->contains($creditHistory)) {
- $this->creditHistories[] = $creditHistory;
- $creditHistory->setUserMerchant($this);
- }
-
- return $this;
- }
-
- public function removeCreditHistory(CreditHistoryInterface $creditHistory): self
- {
- if ($this->creditHistories->contains($creditHistory)) {
- $this->creditHistories->removeElement($creditHistory);
-
- if ($creditHistory->getUserMerchant() === $this) {
- $creditHistory->setUserMerchant(null);
- }
- }
-
- return $this;
- }
- }
|