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

UserBuilder.php 827B

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