|
|
@@ -33,11 +33,6 @@ abstract class User extends UserModelFOS |
|
|
|
*/ |
|
|
|
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"}) |
|
|
|
*/ |
|
|
@@ -97,7 +92,6 @@ abstract class User extends UserModelFOS |
|
|
|
public function __construct() |
|
|
|
{ |
|
|
|
parent::__construct(); |
|
|
|
$this->creditHistories = new ArrayCollection(); |
|
|
|
$this->addresses = new ArrayCollection(); |
|
|
|
$this->orders = new ArrayCollection(); |
|
|
|
$this->groupUsers = new ArrayCollection(); |
|
|
@@ -159,37 +153,6 @@ abstract class User extends UserModelFOS |
|
|
|
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[] |
|
|
|
*/ |