PHP Class Horde_OpenXchange_Base, horde

Mostra file Open project: horde/horde

Protected Properties

Property Type Description
$_client Horde_Http_Client HTTP client
$_cookies array All cookies to sent with OX requests.
$_folderType string The folder category.
$_params array Any parameters.
$_session string The current session ID.
$_uri string Base URI of the API endpoint.

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
getConfig ( string $config ) : mixed Returns user configuration.
getGroup ( integer $id ) : array Returns information about a system group.
getUser ( integer $id ) : array Returns information about a system user.
listResources ( string $type = self::RESOURCE_PRIVATE ) : array Returns a list of visible groupware resources.
login ( string $user, string $password ) Logs a user in.
logout ( ) Logs the current user out.

Protected Methods

Method Description
_login ( ) Logs a user in, if necessary.
_request ( string $method, string $namespace, array $params, array | string $data = [] ) : array Sends a request and parses the response.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array List of optional parameters: - client: (Horde_Http_Client) An HTTP client. - endpoint: (string) The URI of the OX API endpoint. - user: (string) Authentication user. - password: (string) Authentication password.

_login() protected method

Logs a user in, if necessary.
protected _login ( )

_request() protected method

Sends a request and parses the response.
protected _request ( string $method, string $namespace, array $params, array | string $data = [] ) : array
$method string A HTTP request method (uppercase).
$namespace string An API namespace.
$params array URL parameters.
$data array | string Request data.
return array The decoded result data or null if no data has been returned but the request was still successful.

getConfig() public method

Returns user configuration.
public getConfig ( string $config ) : mixed
$config string A configuration namespace.
return mixed Configuration contents.

getGroup() public method

Returns information about a system group.
public getGroup ( integer $id ) : array
$id integer A group ID.
return array Group information hash.

getUser() public method

Returns information about a system user.
public getUser ( integer $id ) : array
$id integer A user ID.
return array User information hash.

listResources() public method

Returns a list of visible groupware resources.
public listResources ( string $type = self::RESOURCE_PRIVATE ) : array
$type string An resource type, one of the RESOURCE_* constants.
return array List of resources with resource IDs as keys and information hashes as values.

login() public method

Logs a user in.
public login ( string $user, string $password )
$user string A user name.
$password string A password.

logout() public method

Logs the current user out.
public logout ( )

Property Details

$_client protected_oe property

HTTP client
protected Horde_Http_Client $_client
return Horde_Http_Client

$_cookies protected_oe property

All cookies to sent with OX requests.
protected array $_cookies
return array

$_folderType protected_oe property

The folder category.
protected string $_folderType
return string

$_params protected_oe property

Any parameters.
protected array $_params
return array

$_session protected_oe property

The current session ID.
protected string $_session
return string

$_uri protected_oe property

Base URI of the API endpoint.
protected string $_uri
return string