| @@ 92-101 (lines=10) @@ | ||
| 89 | * |
|
| 90 | * @return \eZ\Publish\SPI\Persistence\User |
|
| 91 | */ |
|
| 92 | public function load($userId) |
|
| 93 | { |
|
| 94 | $data = $this->userGateway->load($userId); |
|
| 95 | ||
| 96 | if (empty($data)) { |
|
| 97 | throw new NotFound('user', $userId); |
|
| 98 | } |
|
| 99 | ||
| 100 | return $this->mapper->mapUser(reset($data)); |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|
| 104 | * Loads user with user login. |
|
| @@ 178-187 (lines=10) @@ | ||
| 175 | * |
|
| 176 | * @return \eZ\Publish\SPI\Persistence\User |
|
| 177 | */ |
|
| 178 | public function loadUserByToken($hash) |
|
| 179 | { |
|
| 180 | $data = $this->userGateway->loadUserByToken($hash); |
|
| 181 | ||
| 182 | if (empty($data)) { |
|
| 183 | throw new NotFound('user', $hash); |
|
| 184 | } |
|
| 185 | ||
| 186 | return $this->mapper->mapUser(reset($data)); |
|
| 187 | } |
|
| 188 | ||
| 189 | /** |
|
| 190 | * Update the user information specified by the user struct. |
|