/** * Loads user with user ID. * * @param mixed $userId * * @return array */ public function load($userId) { try { return $this->innerGateway->load($userId); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Loads user with user ID. * * @param mixed $userId * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If user is not found * * @return \eZ\Publish\SPI\Persistence\User */ public function load($userId) { $data = $this->userGateway->load($userId); if (empty($data)) { throw new NotFound('user', $userId); } return $this->mapper->mapUser(reset($data)); }