| @@ 97-106 (lines=10) @@ | ||
| 94 | * |
|
| 95 | * @return \eZ\Publish\SPI\Persistence\User |
|
| 96 | */ |
|
| 97 | public function load($userId) |
|
| 98 | { |
|
| 99 | $data = $this->userGateway->load($userId); |
|
| 100 | ||
| 101 | if (empty($data)) { |
|
| 102 | throw new NotFound('user', $userId); |
|
| 103 | } |
|
| 104 | ||
| 105 | return $this->mapper->mapUser(reset($data)); |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * Loads user with user login. |
|
| @@ 160-169 (lines=10) @@ | ||
| 157 | * |
|
| 158 | * @return \eZ\Publish\SPI\Persistence\User |
|
| 159 | */ |
|
| 160 | public function loadUserByToken($hash) |
|
| 161 | { |
|
| 162 | $data = $this->userGateway->loadUserByToken($hash); |
|
| 163 | ||
| 164 | if (empty($data)) { |
|
| 165 | throw new NotFound('user', $hash); |
|
| 166 | } |
|
| 167 | ||
| 168 | return $this->mapper->mapUser(reset($data)); |
|
| 169 | } |
|
| 170 | ||
| 171 | /** |
|
| 172 | * Update the user information specified by the user struct. |
|