\Horde_OpenXchange_Events

Horde_OpenXchange_Events is the interface class for the events storage of an Open-Xchange server.

Summary

Methods
Properties
Constants
__construct()
login()
logout()
getUser()
getGroup()
getConfig()
listResources()
listEvents()
getEvent()
No public properties found
RESOURCE_PRIVATE
RESOURCE_PUBLIC
_listObjects()
_getObject()
_login()
_request()
$_columns
$_folderType
$_params
$_client
$_uri
$_cookies
$_session
N/A
No private methods found
No private properties found
N/A

Constants

RESOURCE_PRIVATE

RESOURCE_PRIVATE

Return private resources.

RESOURCE_PUBLIC

RESOURCE_PUBLIC

Return public resources.

Properties

$_columns

$_columns : array

Column IDs mapped to column names.

Type

array

$_folderType

$_folderType : string

The folder category.

Type

string

$_params

$_params : array

Any parameters.

Type

array

$_client

$_client : \Horde_Http_Client

HTTP client

Type

\Horde_Http_Client

$_uri

$_uri : string

Base URI of the API endpoint.

Type

string

$_cookies

$_cookies : array

All cookies to sent with OX requests.

Type

array

$_session

$_session : string

The current session ID.

Type

string

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

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()

login(string  $user, string  $password) 

Logs a user in.

Parameters

string $user

A user name.

string $password

A password.

Throws

\Horde_OpenXchange_Exception.

logout()

logout() 

Logs the current user out.

Throws

\Horde_OpenXchange_Exception.

getUser()

getUser(integer  $id) : array

Returns information about a system user.

Parameters

integer $id

A user ID.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

User information hash.

getGroup()

getGroup(integer  $id) : array

Returns information about a system group.

Parameters

integer $id

A group ID.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

Group information hash.

getConfig()

getConfig(string  $config) : mixed

Returns user configuration.

Parameters

string $config

A configuration namespace.

Throws

\Horde_OpenXchange_Exception.

Returns

mixed —

Configuration contents.

listResources()

listResources(string  $type = self::RESOURCE_PRIVATE) : array

Returns a list of visible groupware resources.

Parameters

string $type

An resource type, one of the RESOURCE_* constants.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

List of resources with resource IDs as keys and information hashes as values.

listEvents()

listEvents(integer  $folder = null, \Horde_Date  $start = null, \Horde_Date  $end = null) : array

Returns a list events.

Parameters

integer $folder

A folder ID. If empty, returns events of all visible calendars.

\Horde_Date $start

Start date, defaults to epoch.

\Horde_Date $end

End date, defaults to maximum date possible.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

List of event hashes.

getEvent()

getEvent(integer  $folder, integer  $id) : array

Returns an event.

Parameters

integer $folder

A folder ID.

integer $id

An event ID.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

The event hash.

_listObjects()

_listObjects(integer  $folder = null, \Horde_Date  $start = null, \Horde_Date  $end = null) : array

Returns a list of events or tasks.

Parameters

integer $folder

A folder ID. If empty, returns objects of all visible resources.

\Horde_Date $start

Start date, defaults to epoch.

\Horde_Date $end

End date, defaults to maximum date possible.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

List of object hashes.

_getObject()

_getObject(integer  $folder, integer  $id) : array

Returns an event or task.

Parameters

integer $folder

A folder ID.

integer $id

An object ID.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

The object hash.

_login()

_login() 

Logs a user in, if necessary.

Throws

\Horde_OpenXchange_Exception.

_request()

_request(string  $method, string  $namespace, array  $params, array|string  $data = array()) : array

Sends a request and parses the response.

Parameters

string $method

A HTTP request method (uppercase).

string $namespace

An API namespace.

array $params

URL parameters.

array|string $data

Request data.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

The decoded result data or null if no data has been returned but the request was still successful.