您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

30 行
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. }