eZ Publish Community Project (Legacy Stack) 2013.4
Class

ezpRestClient

class ezpRestClient

Persistent object class representing a REST application.

Constants

STATUS_DRAFT

STATUS_PUBLISHED

Properties

$id
string $name Application name
string $description Application description
string $client_id Application client ID, as used over oAuth to authentify the application
string $client_secret Application client secret, as used over oAuth to authentify the application
string $endpoint_uri Application client endpoint URI.
int $owner_id ID of the eZ Publish user who owns the application
int $created Application creation date, as a unix timestamp
int $updated Application update date, as a unix timestamp
int $version Application version, used to pre-create a draft when first creation a new application.

Methods

getState()

setState(array $properties)

mixed attribute(string $attributeName)

eZPersistentObject wrapper method

bool hasAttribute(string $attributeName)

eZPersistentObject wrapper method

mixed __get(string $propertyName)

eZPersistentObject wrapper method: handles "function attributes"

__isset($propertyName)

static bool authorizeApplication($clientId, $endPointUri, $clientSecret = null)

Validates an authorization request by an application using the ID, redirection URI and secret if provided.

static ezpRestClient fetchByClientId(string $clientId)

Fetches a rest application using a client Id

bool validateSecret($secret $secret)

Convenience method to validate a client secret.

bool isAuthorizedByUser(mixed $scope, eZUser $user = null)

Checks if this application has been authorized by the current user

void authorizeFor(eZUser $user = null)

Authorizes this application for a user

bool isEndPointValid(string $endPointUri)

Validates an attempt (endpoint) redirect URI against the one configured for the client

Details

at line 72
public getState()

at line 88
public setState(array $properties)

Parameters

array $properties

at line 101
public mixed attribute(string $attributeName)

eZPersistentObject wrapper method

Parameters

string $attributeName

Return Value

mixed

at line 116
public bool hasAttribute(string $attributeName)

eZPersistentObject wrapper method

Parameters

string $attributeName

Return Value

bool

at line 127
public mixed __get(string $propertyName)

eZPersistentObject wrapper method: handles "function attributes"

Parameters

string $propertyName

Return Value

mixed

at line 157
public __isset($propertyName)

Parameters

$propertyName

at line 172
static public bool authorizeApplication($clientId, $endPointUri, $clientSecret = null)

Validates an authorization request by an application using the ID, redirection URI and secret if provided.

Parameters

$clientId
$endPointUri
$clientSecret

Return Value

bool True if the app is valid, false if it isn't

at line 194
static public ezpRestClient fetchByClientId(string $clientId)

Fetches a rest application using a client Id

Parameters

string $clientId

Return Value

ezpRestClient

at line 213
public bool validateSecret($secret $secret)

Convenience method to validate a client secret.

Parameters

$secret $secret

Return Value

bool

at line 228
public bool isAuthorizedByUser(mixed $scope, eZUser $user = null)

Checks if this application has been authorized by the current user

Parameters

mixed $scope The requested security scope
eZUser $user The user to check authorization for. Will check for current user if not given.

Return Value

bool

at line 245
public void authorizeFor(eZUser $user = null)

Authorizes this application for a user

Parameters

eZUser $user

Return Value

void

at line 262
public bool isEndPointValid(string $endPointUri)

Validates an attempt (endpoint) redirect URI against the one configured for the client

Parameters

string $endPointUri

Return Value

bool true if the URI is valid, false otherwise