|
|
@@ -6,6 +6,11 @@ use Doctrine\Common\Collections\ArrayCollection; |
|
|
|
use Doctrine\Common\Collections\Collection; |
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
|
|
|
use Lc\CaracoleBundle\Model\Address\AddressInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Newsletter\NewsletterInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; |
|
|
|
use Lc\SovBundle\Model\User\User as SovUserModel; |
|
|
|
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Ticket\TicketInterface; |
|
|
@@ -123,7 +128,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
) . ' (' . $this->getEmail() . ')'; |
|
|
|
} |
|
|
|
|
|
|
|
public function getName() :string |
|
|
|
public function getName(): ?string |
|
|
|
{ |
|
|
|
return (string)ucfirst(strtolower($this->getFirstname())) . ' ' . strtoupper($this->getLastname()); |
|
|
|
} |
|
|
@@ -165,7 +170,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|Address[] |
|
|
|
* @return Collection|AddressInterface[] |
|
|
|
*/ |
|
|
|
public function getAddresses($status = null): Collection |
|
|
|
{ |
|
|
@@ -182,7 +187,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function addAddress(Address $address): self |
|
|
|
public function addAddress(AddressInterface $address): self |
|
|
|
{ |
|
|
|
if (!$this->addresses->contains($address)) { |
|
|
|
$this->addresses[] = $address; |
|
|
@@ -192,7 +197,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function removeAddress(Address $address): self |
|
|
|
public function removeAddress(AddressInterface $address): self |
|
|
|
{ |
|
|
|
if ($this->addresses->contains($address)) { |
|
|
|
$this->addresses->removeElement($address); |
|
|
@@ -206,14 +211,14 @@ abstract class UserModel extends SovUserModel |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|OrderShop[] |
|
|
|
* @return Collection|OrderShopInterface[] |
|
|
|
*/ |
|
|
|
public function getOrders(): Collection |
|
|
|
{ |
|
|
|
return $this->orders; |
|
|
|
} |
|
|
|
|
|
|
|
public function addOrder(OrderShop $order): self |
|
|
|
public function addOrder(OrderShopInterface $order): self |
|
|
|
{ |
|
|
|
if (!$this->orders->contains($order)) { |
|
|
|
$this->orders[] = $order; |
|
|
@@ -223,7 +228,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function removeOrder(OrderShop $order): self |
|
|
|
public function removeOrder(OrderShopInterface $order): self |
|
|
|
{ |
|
|
|
if ($this->orders->contains($order)) { |
|
|
|
$this->orders->removeElement($order); |
|
|
@@ -273,14 +278,14 @@ abstract class UserModel extends SovUserModel |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|Newsletter[] |
|
|
|
* @return Collection|NewsletterInterface[] |
|
|
|
*/ |
|
|
|
public function getNewsletters(): Collection |
|
|
|
{ |
|
|
|
return $this->newsletters; |
|
|
|
} |
|
|
|
|
|
|
|
public function addNewsletter(Newsletter $newsletter): self |
|
|
|
public function addNewsletter(NewsletterInterface $newsletter): self |
|
|
|
{ |
|
|
|
if (!$this->newsletters->contains($newsletter)) { |
|
|
|
$this->newsletters[] = $newsletter; |
|
|
@@ -289,7 +294,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function removeNewsletter(Newsletter $newsletter): self |
|
|
|
public function removeNewsletter(NewsletterInterface $newsletter): self |
|
|
|
{ |
|
|
|
if ($this->newsletters->contains($newsletter)) { |
|
|
|
$this->newsletters->removeElement($newsletter); |
|
|
@@ -299,14 +304,14 @@ abstract class UserModel extends SovUserModel |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|GroupUserModel[] |
|
|
|
* @return Collection|GroupUserInterface[] |
|
|
|
*/ |
|
|
|
public function getGroupUsers(): Collection |
|
|
|
{ |
|
|
|
return $this->groupUsers; |
|
|
|
} |
|
|
|
|
|
|
|
public function addGroupUser(GroupUserModel $groupUser): self |
|
|
|
public function addGroupUser(GroupUserInterface $groupUser): self |
|
|
|
{ |
|
|
|
if (!$this->groupUsers->contains($groupUser)) { |
|
|
|
$this->groupUsers[] = $groupUser; |
|
|
@@ -316,7 +321,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function removeGroupUser(GroupUserModel $groupUser): self |
|
|
|
public function removeGroupUser(GroupUserInterface $groupUser): self |
|
|
|
{ |
|
|
|
if ($this->groupUsers->contains($groupUser)) { |
|
|
|
$this->groupUsers->removeElement($groupUser); |
|
|
@@ -327,14 +332,14 @@ abstract class UserModel extends SovUserModel |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|ProductFamily[] |
|
|
|
* @return Collection|ProductFamilyInterface[] |
|
|
|
*/ |
|
|
|
public function getFavoriteProductFamilies(): Collection |
|
|
|
{ |
|
|
|
return $this->favoriteProductFamilies; |
|
|
|
} |
|
|
|
|
|
|
|
public function addFavoriteProductFamily(ProductFamily $favoriteProductFamily): self |
|
|
|
public function addFavoriteProductFamily(ProductFamilyInterface $favoriteProductFamily): self |
|
|
|
{ |
|
|
|
if (!$this->favoriteProductFamilies->contains($favoriteProductFamily)) { |
|
|
|
$this->favoriteProductFamilies[] = $favoriteProductFamily; |
|
|
@@ -343,7 +348,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function removeFavoriteProductFamily(ProductFamily $favoriteProductFamily): self |
|
|
|
public function removeFavoriteProductFamily(ProductFamilyInterface $favoriteProductFamily): self |
|
|
|
{ |
|
|
|
if ($this->favoriteProductFamilies->contains($favoriteProductFamily)) { |
|
|
|
$this->favoriteProductFamilies->removeElement($favoriteProductFamily); |
|
|
@@ -353,14 +358,14 @@ abstract class UserModel extends SovUserModel |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|UserPointSaleModel[] |
|
|
|
* @return Collection|UserPointSaleInterface[] |
|
|
|
*/ |
|
|
|
public function getUserPointSales(): Collection |
|
|
|
{ |
|
|
|
return $this->userPointSales; |
|
|
|
} |
|
|
|
|
|
|
|
public function addUserPointSale(UserPointSale $userPointSale): self |
|
|
|
public function addUserPointSale(UserPointSaleInterface $userPointSale): self |
|
|
|
{ |
|
|
|
if (!$this->userPointSales->contains($userPointSale)) { |
|
|
|
$this->userPointSales[] = $userPointSale; |
|
|
@@ -370,7 +375,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function removeUserPointSale(UserPointSale $userPointSale): self |
|
|
|
public function removeUserPointSale(UserPointSaleInterface $userPointSale): self |
|
|
|
{ |
|
|
|
if ($this->userPointSales->contains($userPointSale)) { |
|
|
|
$this->userPointSales->removeElement($userPointSale); |
|
|
@@ -452,14 +457,14 @@ abstract class UserModel extends SovUserModel |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|ReductionCredit[] |
|
|
|
* @return Collection|ReductionCreditInterface[] |
|
|
|
*/ |
|
|
|
public function getReductionCredits(): Collection |
|
|
|
{ |
|
|
|
return $this->reductionCredits; |
|
|
|
} |
|
|
|
|
|
|
|
public function addReductionCredit(ReductionCredit $reductionCredit): self |
|
|
|
public function addReductionCredit(ReductionCreditInterface $reductionCredit): self |
|
|
|
{ |
|
|
|
if (!$this->reductionCredits->contains($reductionCredit)) { |
|
|
|
$this->reductionCredits[] = $reductionCredit; |
|
|
@@ -469,7 +474,7 @@ abstract class UserModel extends SovUserModel |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function removeReductionCredit(ReductionCredit $reductionCredit): self |
|
|
|
public function removeReductionCredit(ReductionCreditInterface $reductionCredit): self |
|
|
|
{ |
|
|
|
if ($this->reductionCredits->contains($reductionCredit)) { |
|
|
|
$this->reductionCredits->removeElement($reductionCredit); |