isLinkedToPointSale($pointSale)) { $userPointSaleFactory = new UserPointSaleFactory(); $userPointSale = $userPointSaleFactory->create($user, $pointSale); $this->entityManager->persist($userPointSale); $this->entityManager->flush(); return true; } return false; } }