Przeglądaj źródła

Bug favorite merchant null

packProduct
Fabien Normand 2 lat temu
rodzic
commit
80c153aa74
1 zmienionych plików z 10 dodań i 1 usunięć
  1. +10
    -1
      Builder/User/UserBuilder.php

+ 10
- 1
Builder/User/UserBuilder.php Wyświetl plik

namespace Lc\CaracoleBundle\Builder\User; namespace Lc\CaracoleBundle\Builder\User;


use Lc\CaracoleBundle\Factory\User\UserPointSaleFactory; use Lc\CaracoleBundle\Factory\User\UserPointSaleFactory;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\SovBundle\Model\User\UserInterface; use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Builder\User\UserBuilder as SovUserBuilder; use Lc\SovBundle\Builder\User\UserBuilder as SovUserBuilder;
{ {


// linkUserToPointSale // linkUserToPointSale
public function linkToPointSale(UserInterface $user, PointSaleInterface $pointSale):bool
public function linkToPointSale(UserInterface $user, PointSaleInterface $pointSale): bool
{ {
if (!$this->userSolver->isLinkedToPointSale($user, $pointSale)) { if (!$this->userSolver->isLinkedToPointSale($user, $pointSale)) {
$userPointSaleFactory = new UserPointSaleFactory(); $userPointSaleFactory = new UserPointSaleFactory();


return false; return false;
} }

public function setFavoriteMerchant(UserInterface $user, MerchantInterface $merchant)
{
$user->setFavoriteMerchant($merchant);
$this->entityManager->update($user);
$this->entityManager->flush();
return true;
}
} }



Ładowanie…
Anuluj
Zapisz