\Horde_OpenXchange_Tasks

Horde_OpenXchange_Tasks is the interface class for the tasks storage of an Open-Xchange server.

Summary

Methods
Properties
Constants
__construct()
login()
logout()
getUser()
getGroup()
getConfig()
listResources()
listTasks()
getTask()
No public properties found
RESOURCE_PRIVATE
RESOURCE_PUBLIC
STATUS_NOT_STARTED
STATUS_IN_PROGRESS
STATUS_DONE
STATUS_WAITING
STATUS_DEFERRED
PRIORITY_LOW
PRIORITY_MEDIUM
PRIORITY_HIGH
_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.

STATUS_NOT_STARTED

STATUS_NOT_STARTED

Status: not started.

STATUS_IN_PROGRESS

STATUS_IN_PROGRESS

Status: in progress.

STATUS_DONE

STATUS_DONE

Status: done.

STATUS_WAITING

STATUS_WAITING

Status: waiting.

STATUS_DEFERRED

STATUS_DEFERRED

Status: deferred.

PRIORITY_LOW

PRIORITY_LOW

Priority: high.

PRIORITY_MEDIUM

PRIORITY_MEDIUM

Priority: high.

PRIORITY_HIGH

PRIORITY_HIGH

Priority: high.

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.

listTasks()

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

Returns a list tasks.

Parameters

integer $folder

A folder ID. If empty, returns tasks of all visible task lists.

\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 task hashes.

getTask()

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

Returns an task.

Parameters

integer $folder

A folder ID.

integer $id

An task ID.

Throws

\Horde_OpenXchange_Exception.

Returns

array —

The task 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.