public function loadUser($userId, array $prioritizedLanguages = [])
    {
        /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */
        $content = $this->repository->getContentService()->internalLoadContent($userId, $prioritizedLanguages);
        // Get spiUser value from Field Value
        foreach ($content->getFields() as $field) {
            if (!$field->value instanceof UserValue) {
                continue;
            }

            /** @var \eZ\Publish\Core\FieldType\User\Value $value */
            $value = $field->value;
            $spiUser = new SPIUser();
            $spiUser->id = $value->contentId;
            $spiUser->login = $value->login;
            $spiUser->email = $value->email;
            $spiUser->hashAlgorithm = $value->passwordHashType;
            $spiUser->passwordHash = $value->passwordHash;
            $spiUser->isEnabled = $value->enabled;
            $spiUser->maxLogin = $value->maxLogin;
            break;
        }

        // If for some reason not found, load it
        if (!isset($spiUser)) {
            $spiUser = $this->userHandler->load($userId);
        }

        return $this->buildDomainUserObject($spiUser, $content);
    }
public function loadUser($userId, array $prioritizedLanguages = [])
    {
        /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */
        $content = $this->repository->getContentService()->internalLoadContent($userId, $prioritizedLanguages);
        // Get spiUser value from Field Value
        foreach ($content->getFields() as $field) {
            if (!$field->value instanceof UserValue) {
                continue;
            }

            /** @var \eZ\Publish\Core\FieldType\User\Value $value */
            $value = $field->value;
            $spiUser = new SPIUser();
            $spiUser->id = $value->contentId;
            $spiUser->login = $value->login;
            $spiUser->email = $value->email;
            $spiUser->hashAlgorithm = $value->passwordHashType;
            $spiUser->passwordHash = $value->passwordHash;
            $spiUser->isEnabled = $value->enabled;
            $spiUser->maxLogin = $value->maxLogin;
            break;
        }

        // If for some reason not found, load it
        if (!isset($spiUser)) {
            $spiUser = $this->userHandler->load($userId);
        }

        return $this->buildDomainUserObject($spiUser, $content);
    }
public function loadUser ( $ userId , array $ prioritizedLanguages = [ ] ) { /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */ $ content = $ this -> repository -> getContentService ( ) -> internalLoadContent ( $ userId , $ prioritizedLanguages ) ; // Get spiUser value from Field Value foreach ( $ content -> getFields ( ) as $ field ) { if ( ! $ field -> value instanceof UserValue ) { continue ; } /** @var \eZ\Publish\Core\FieldType\User\Value $value */ $ value = $ field -> value ; $ spiUser = new SPIUser ( ) ; $ spiUser -> id = $ value -> contentId ; $ spiUser -> login = $ value -> login ; $ spiUser -> email = $ value -> email ; $ spiUser -> hashAlgorithm = $ value -> passwordHashType ; $ spiUser -> passwordHash = $ value -> passwordHash ; $ spiUser -> isEnabled = $ value -> enabled ; $ spiUser -> maxLogin = $ value -> maxLogin ; break ; } // If for some reason not found, load it if ( ! isset ( $ spiUser ) ) { $ spiUser = $ this -> userHandler -> load ( $ userId ) ; } return $ this -> buildDomainUserObject ( $ spiUser , $ content ) ; }
Loads a user.

@param mixed $userId
@param string[] $prioritizedLanguages Used as prioritized language code on translated properties of returned object.

@return \eZ\Publish\API\Repository\Values\User\User

@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException if a user with the given id was not found
Loads a user .