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

->setSearchFields(['id', 'title', 'description', 'devAlias', 'position', 'status', 'slug', 'image', 'metaTitle', 'metaDescription', 'oldUrls']) ->setSearchFields(['id', 'title', 'description', 'devAlias', 'position', 'status', 'slug', 'image', 'metaTitle', 'metaDescription', 'oldUrls'])
->setPaginatorPageSize(50) ->setPaginatorPageSize(50)
->setEntityPermission('ROLE_ADMIN') ->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 public function configureFields(string $pageName): iterable

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

use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; 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\SovBundle\Model\User\User as SovUserModel;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Ticket\TicketInterface; use Lc\CaracoleBundle\Model\Ticket\TicketInterface;
) . ' (' . $this->getEmail() . ')'; ) . ' (' . $this->getEmail() . ')';
} }


public function getName() :string
public function getName(): ?string
{ {
return (string)ucfirst(strtolower($this->getFirstname())) . ' ' . strtoupper($this->getLastname()); return (string)ucfirst(strtolower($this->getFirstname())) . ' ' . strtoupper($this->getLastname());
} }
} }


/** /**
* @return Collection|Address[]
* @return Collection|AddressInterface[]
*/ */
public function getAddresses($status = null): Collection public function getAddresses($status = null): Collection
{ {
} }
} }


public function addAddress(Address $address): self
public function addAddress(AddressInterface $address): self
{ {
if (!$this->addresses->contains($address)) { if (!$this->addresses->contains($address)) {
$this->addresses[] = $address; $this->addresses[] = $address;
return $this; return $this;
} }


public function removeAddress(Address $address): self
public function removeAddress(AddressInterface $address): self
{ {
if ($this->addresses->contains($address)) { if ($this->addresses->contains($address)) {
$this->addresses->removeElement($address); $this->addresses->removeElement($address);
} }


/** /**
* @return Collection|OrderShop[]
* @return Collection|OrderShopInterface[]
*/ */
public function getOrders(): Collection public function getOrders(): Collection
{ {
return $this->orders; return $this->orders;
} }


public function addOrder(OrderShop $order): self
public function addOrder(OrderShopInterface $order): self
{ {
if (!$this->orders->contains($order)) { if (!$this->orders->contains($order)) {
$this->orders[] = $order; $this->orders[] = $order;
return $this; return $this;
} }


public function removeOrder(OrderShop $order): self
public function removeOrder(OrderShopInterface $order): self
{ {
if ($this->orders->contains($order)) { if ($this->orders->contains($order)) {
$this->orders->removeElement($order); $this->orders->removeElement($order);
} }


/** /**
* @return Collection|Newsletter[]
* @return Collection|NewsletterInterface[]
*/ */
public function getNewsletters(): Collection public function getNewsletters(): Collection
{ {
return $this->newsletters; return $this->newsletters;
} }


public function addNewsletter(Newsletter $newsletter): self
public function addNewsletter(NewsletterInterface $newsletter): self
{ {
if (!$this->newsletters->contains($newsletter)) { if (!$this->newsletters->contains($newsletter)) {
$this->newsletters[] = $newsletter; $this->newsletters[] = $newsletter;
return $this; return $this;
} }


public function removeNewsletter(Newsletter $newsletter): self
public function removeNewsletter(NewsletterInterface $newsletter): self
{ {
if ($this->newsletters->contains($newsletter)) { if ($this->newsletters->contains($newsletter)) {
$this->newsletters->removeElement($newsletter); $this->newsletters->removeElement($newsletter);
} }


/** /**
* @return Collection|GroupUserModel[]
* @return Collection|GroupUserInterface[]
*/ */
public function getGroupUsers(): Collection public function getGroupUsers(): Collection
{ {
return $this->groupUsers; return $this->groupUsers;
} }


public function addGroupUser(GroupUserModel $groupUser): self
public function addGroupUser(GroupUserInterface $groupUser): self
{ {
if (!$this->groupUsers->contains($groupUser)) { if (!$this->groupUsers->contains($groupUser)) {
$this->groupUsers[] = $groupUser; $this->groupUsers[] = $groupUser;
return $this; return $this;
} }


public function removeGroupUser(GroupUserModel $groupUser): self
public function removeGroupUser(GroupUserInterface $groupUser): self
{ {
if ($this->groupUsers->contains($groupUser)) { if ($this->groupUsers->contains($groupUser)) {
$this->groupUsers->removeElement($groupUser); $this->groupUsers->removeElement($groupUser);
} }


/** /**
* @return Collection|ProductFamily[]
* @return Collection|ProductFamilyInterface[]
*/ */
public function getFavoriteProductFamilies(): Collection public function getFavoriteProductFamilies(): Collection
{ {
return $this->favoriteProductFamilies; return $this->favoriteProductFamilies;
} }


public function addFavoriteProductFamily(ProductFamily $favoriteProductFamily): self
public function addFavoriteProductFamily(ProductFamilyInterface $favoriteProductFamily): self
{ {
if (!$this->favoriteProductFamilies->contains($favoriteProductFamily)) { if (!$this->favoriteProductFamilies->contains($favoriteProductFamily)) {
$this->favoriteProductFamilies[] = $favoriteProductFamily; $this->favoriteProductFamilies[] = $favoriteProductFamily;
return $this; return $this;
} }


public function removeFavoriteProductFamily(ProductFamily $favoriteProductFamily): self
public function removeFavoriteProductFamily(ProductFamilyInterface $favoriteProductFamily): self
{ {
if ($this->favoriteProductFamilies->contains($favoriteProductFamily)) { if ($this->favoriteProductFamilies->contains($favoriteProductFamily)) {
$this->favoriteProductFamilies->removeElement($favoriteProductFamily); $this->favoriteProductFamilies->removeElement($favoriteProductFamily);
} }


/** /**
* @return Collection|UserPointSaleModel[]
* @return Collection|UserPointSaleInterface[]
*/ */
public function getUserPointSales(): Collection public function getUserPointSales(): Collection
{ {
return $this->userPointSales; return $this->userPointSales;
} }


public function addUserPointSale(UserPointSale $userPointSale): self
public function addUserPointSale(UserPointSaleInterface $userPointSale): self
{ {
if (!$this->userPointSales->contains($userPointSale)) { if (!$this->userPointSales->contains($userPointSale)) {
$this->userPointSales[] = $userPointSale; $this->userPointSales[] = $userPointSale;
return $this; return $this;
} }


public function removeUserPointSale(UserPointSale $userPointSale): self
public function removeUserPointSale(UserPointSaleInterface $userPointSale): self
{ {
if ($this->userPointSales->contains($userPointSale)) { if ($this->userPointSales->contains($userPointSale)) {
$this->userPointSales->removeElement($userPointSale); $this->userPointSales->removeElement($userPointSale);
} }


/** /**
* @return Collection|ReductionCredit[]
* @return Collection|ReductionCreditInterface[]
*/ */
public function getReductionCredits(): Collection public function getReductionCredits(): Collection
{ {
return $this->reductionCredits; return $this->reductionCredits;
} }


public function addReductionCredit(ReductionCredit $reductionCredit): self
public function addReductionCredit(ReductionCreditInterface $reductionCredit): self
{ {
if (!$this->reductionCredits->contains($reductionCredit)) { if (!$this->reductionCredits->contains($reductionCredit)) {
$this->reductionCredits[] = $reductionCredit; $this->reductionCredits[] = $reductionCredit;
return $this; return $this;
} }


public function removeReductionCredit(ReductionCredit $reductionCredit): self
public function removeReductionCredit(ReductionCreditInterface $reductionCredit): self
{ {
if ($this->reductionCredits->contains($reductionCredit)) { if ($this->reductionCredits->contains($reductionCredit)) {
$this->reductionCredits->removeElement($reductionCredit); $this->reductionCredits->removeElement($reductionCredit);

Loading…
Cancel
Save