You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 satır
818B

  1. <?php
  2. namespace Lc\CaracoleBundle\Builder\User;
  3. use Doctrine\ORM\EntityManagerInterface;
  4. use Lc\CaracoleBundle\Factory\User\UserPointSaleFactory;
  5. use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
  6. use Lc\SovBundle\Model\User\UserInterface;
  7. use Lc\SovBundle\Builder\User\UserBuilder as SovUserBuilder;
  8. class UserBuilder extends SovUserBuilder
  9. {
  10. public function linkToPointSale(UserInterface $user, PointSaleInterface $pointSale)
  11. {
  12. if (!$user->isLinkedToPointSale($pointSale)) {
  13. $userPointSaleFactory = new UserPointSaleFactory();
  14. $userPointSale = $userPointSaleFactory->create($user, $pointSale);
  15. $this->entityManager->persist($userPointSale);
  16. $this->entityManager->flush();
  17. return true;
  18. }
  19. return false;
  20. }
  21. }