public function loadUser( $id )
    {
        /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $userService = $repository->getUserService();

        $user = $repository->sudo(
            function() use( $id, $userService )
            {
                return $userService->loadUser( $id );
            }
        );

        return $user;
    }
public function loadUser( $id )
    {
        /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $userService = $repository->getUserService();

        $user = $repository->sudo(
            function() use( $id, $userService )
            {
                return $userService->loadUser( $id );
            }
        );

        return $user;
    }
public function loadUser ( $ id ) { /** @var \eZ\Publish\API\Repository\Repository $repository */ $ repository = $ this -> getRepository ( ) ; $ userService = $ repository -> getUserService ( ) ; $ user = $ repository -> sudo ( function ( ) use ( $ id , $ userService ) { return $ userService -> loadUser ( $ id ) ; } ) ; return $ user ; }
Load a User by id

@param int $id User content identifier

@return \eZ\Publish\API\Repository\Values\User\User
Load a User by id