|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
protected $merchant; |
|
|
protected $merchant; |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\CreditHistoryInterface", mappedBy="user", orphanRemoval=true) |
|
|
|
|
|
*/ |
|
|
|
|
|
protected $creditHistories; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\AddressInterface", mappedBy="user", cascade={"persist"}) |
|
|
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\AddressInterface", mappedBy="user", cascade={"persist"}) |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
public function __construct() |
|
|
public function __construct() |
|
|
{ |
|
|
{ |
|
|
parent::__construct(); |
|
|
parent::__construct(); |
|
|
$this->creditHistories = new ArrayCollection(); |
|
|
|
|
|
$this->addresses = new ArrayCollection(); |
|
|
$this->addresses = new ArrayCollection(); |
|
|
$this->orders = new ArrayCollection(); |
|
|
$this->orders = new ArrayCollection(); |
|
|
$this->groupUsers = new ArrayCollection(); |
|
|
$this->groupUsers = new ArrayCollection(); |
|
|
|
|
|
|
|
|
return $this; |
|
|
return $this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @return Collection|CreditHistory[] |
|
|
|
|
|
*/ |
|
|
|
|
|
public function getCreditHistories(): Collection |
|
|
|
|
|
{ |
|
|
|
|
|
return $this->creditHistories; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function addCreditHistory(CreditHistory $creditHistory): self |
|
|
|
|
|
{ |
|
|
|
|
|
if (!$this->creditHistories->contains($creditHistory)) { |
|
|
|
|
|
$this->creditHistories[] = $creditHistory; |
|
|
|
|
|
$creditHistory->setUser($this); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $this; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function removeCreditHistory(CreditHistory $creditHistory): self |
|
|
|
|
|
{ |
|
|
|
|
|
if ($this->creditHistories->contains($creditHistory)) { |
|
|
|
|
|
$this->creditHistories->removeElement($creditHistory); |
|
|
|
|
|
// set the owning side to null (unless already changed) |
|
|
|
|
|
if ($creditHistory->getUser() === $this) { |
|
|
|
|
|
$creditHistory->setUser(null); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $this; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @return Collection|Address[] |
|
|
* @return Collection|Address[] |
|
|
*/ |
|
|
*/ |