findUserByEmail() публичный Метод

Find a user by its email
public findUserByEmail ( string $email ) : User
$email string
Результат User or null if user does not exist
Пример #1
0
 /**
  * @param string $email
  * @param string $pw
  * @return \FOS\UserBundle\Model\UserInterface|null
  */
 function getUserByEmailPw($email, $pw)
 {
     $result = null;
     if ($email && $pw) {
         $user = $this->_fosUserManager->findUserByEmail($email);
         if ($user && $this->isPasswordValid($user, $pw)) {
             $result = $user;
         }
     }
     return $result;
 }
Пример #2
0
 /**
  * @param  HookInterface $apiService
  * @param  string        $entityName
  * @return mixed $entityName instance
  */
 public function hydrate(HookInterface $apiService, $entityName)
 {
     $hydratedEntity = new $entityName();
     if (!$hydratedEntity instanceof HookEventInterface) {
         throw new LogicException("Can't hydrate this event");
     }
     $hydratedEntity->setEmail($apiService->getEmail());
     $hydratedEntity->setName($apiService->getService());
     $hydratedEntity->setMetaData($apiService->getMetaData());
     $user = $this->userManager->findUserByEmail($apiService->getEmail());
     $hydratedEntity->setUser($user);
     return $hydratedEntity;
 }
Пример #3
0
 public function findUserByEmail($mail)
 {
     return $this->userManager->findUserByEmail($mail);
 }