loadByLogin() abstract public method

Loads user with user login.
abstract public loadByLogin ( string $login ) : array
$login string
return array
 /**
  * Loads user with user login.
  *
  * @param string $login
  *
  * @return array
  */
 public function loadByLogin($login)
 {
     try {
         return $this->innerGateway->loadByLogin($login);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }
Beispiel #2
0
 /**
  * Loads user with user login.
  *
  * @param string $login
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If user is not found
  *
  * @return \eZ\Publish\SPI\Persistence\User
  */
 public function loadByLogin($login)
 {
     $data = $this->userGateway->loadByLogin($login);
     if (empty($data)) {
         throw new NotFound('user', $login);
     } elseif (isset($data[1])) {
         throw new LogicException("Found more then one user with login '{$login}'");
     }
     return $this->mapper->mapUser($data[0]);
 }