Browse Source

Correctifs

feature/ticket
Guillaume 3 years ago
parent
commit
55eb8420ec
2 changed files with 33 additions and 28 deletions
  1. +6
    -6
      Controller/User/GroupUserCrudController.php
  2. +27
    -22
      Model/User/UserModel.php

+ 6
- 6
Controller/User/GroupUserCrudController.php View File

@@ -23,12 +23,12 @@ abstract class GroupUserCrudController extends AbstractCrudController
->setSearchFields(['id', 'title', 'description', 'devAlias', 'position', 'status', 'slug', 'image', 'metaTitle', 'metaDescription', 'oldUrls'])
->setPaginatorPageSize(50)
->setEntityPermission('ROLE_ADMIN')
->overrideTemplate('layout', '@LcShop/backend/default/layout/layout.html.twig')
->overrideTemplate('menu', '@LcShop/backend/default/menu.html.twig')
->overrideTemplate('crud/edit', '@LcShop/backend/default/edit.html.twig')
->overrideTemplate('crud/index', '@LcShop/backend/default/list.html.twig')
->overrideTemplate('crud/new', '@LcShop/backend/default/new.html.twig')
->overrideTemplate('crud/paginator', '@LcShop/backend/default/block/paginator.html.twig');
->overrideTemplate('layout', '@LcCaracole/backend/default/layout/layout.html.twig')
->overrideTemplate('main_menu', '@LcCaracole/backend/default/menu.html.twig')
->overrideTemplate('crud/edit', '@LcCaracole/backend/default/edit.html.twig')
->overrideTemplate('crud/index', '@LcCaracole/backend/default/list.html.twig')
->overrideTemplate('crud/new', '@LcCaracole/backend/default/new.html.twig')
->overrideTemplate('crud/paginator', '@LcCaracole/backend/default/block/paginator.html.twig');
}

public function configureFields(string $pageName): iterable

+ 27
- 22
Model/User/UserModel.php View File

@@ -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);

Loading…
Cancel
Save