Pārlūkot izejas kodu

Bug favorite merchant null

packProduct
Fabien Normand pirms 2 gadiem
vecāks
revīzija
80c153aa74
1 mainītis faili ar 10 papildinājumiem un 1 dzēšanām
  1. +10
    -1
      Builder/User/UserBuilder.php

+ 10
- 1
Builder/User/UserBuilder.php Parādīt failu

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Builder\User;

use Lc\CaracoleBundle\Factory\User\UserPointSaleFactory;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Builder\User\UserBuilder as SovUserBuilder;
@@ -11,7 +12,7 @@ class UserBuilder extends SovUserBuilder
{

// linkUserToPointSale
public function linkToPointSale(UserInterface $user, PointSaleInterface $pointSale):bool
public function linkToPointSale(UserInterface $user, PointSaleInterface $pointSale): bool
{
if (!$this->userSolver->isLinkedToPointSale($user, $pointSale)) {
$userPointSaleFactory = new UserPointSaleFactory();
@@ -25,5 +26,13 @@ class UserBuilder extends SovUserBuilder

return false;
}

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


Notiek ielāde…
Atcelt
Saglabāt