Documentation

Nag_Driver
in package

Nag_Driver:: defines an API for implementing storage backends for Nag.

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Tags
author

Jon Parise jon@horde.org

author

Jan Schneider jan@horde.org

Table of Contents

$tasks  : Nag_Task
A Nag_Task instance holding the current task list.
$_errormsg  : string
An error message to throw when something is wrong.
$_params  : array<string|int, mixed>
Hash containing connection parameters.
$_tasklist  : string
String containing the current tasklist.
__construct()  : Nag_Driver
Constructor - just store the $params in our newly-created object. All other work is done by initialize().
add()  : array<string|int, mixed>
Adds a task and handles notification.
delete()  : mixed
Deletes a task and handles notification.
deleteAll()  : mixed
Deletes all tasks for the current task list.
get()  : Nag_Task
Retrieves one task from the database.
getByUID()  : Nag_Task
Retrieves one or multiple tasks from the database by UID.
getChildren()  : array<string|int, mixed>
Retrieves sub-tasks from the database.
listAlarms()  : array<string|int, mixed>
List all alarms near $date.
modify()  : mixed
Modifies an existing task and handles notification.
open()  : mixed
Sets the currently open tasklist.
retrieve()  : mixed
Retrieves tasks from the database.
synchronize()  : mixed
Synchronize with the Kolab backend.
_add()  : mixed
_addTags()  : mixed
Helper function to add tags from a newly created event to the tagger.
_modify()  : mixed
_updateTags()  : mixed
Helper function to update an existing event's tags to tagger storage.

Properties

$tasks

A Nag_Task instance holding the current task list.

public Nag_Task $tasks

$_errormsg

An error message to throw when something is wrong.

protected string $_errormsg

$_params

Hash containing connection parameters.

protected array<string|int, mixed> $_params = array()

$_tasklist

String containing the current tasklist.

protected string $_tasklist = ''

Methods

__construct()

Constructor - just store the $params in our newly-created object. All other work is done by initialize().

public __construct([array<string|int, mixed> $params = array() ][, string $errormsg = null ]) : Nag_Driver
Parameters
$params : array<string|int, mixed> = array()

Any parameters needed for this driver.

$errormsg : string = null

Custom error message

Return values
Nag_Driver

add()

Adds a task and handles notification.

public add(array<string|int, mixed> $task) : array<string|int, mixed>
Parameters
$task : array<string|int, mixed>

A hash with the following possible properties:

  • desc: (string) The description (long) of the task.
  • name: (string) The name (short) of the task.
  • actual: (OPTIONAL, float) The actual time spent on the task.
  • alarm: (OPTIONAL, integer) The alarm associated with the task.
  • assignee: (OPTIONAL, string) The assignee of the event.
  • completed: (OPTIONAL, integer) The completion state of the task.
  • completed_date: (OPTIONAL, integer) The task's completion date.
  • due: (OPTIONAL, integer) The due date of the task.
  • estimate: (OPTIONAL, float) The estimated time to complete the task.
  • methods: (OPTIONAL, array) The overridden alarm notification methods.
  • owner: (OPTIONAL, string) The owner of the event.
  • parent: (OPTIONAL, string) The parent task.
  • priority: (OPTIONAL, integer) The priority of the task.
  • private: (OPTIONAL, boolean) Whether the task is private.
  • recurrence: (OPTIONAL, Horde_Date_Recurrence|array) Recurrence information.
  • start: (OPTIONAL, integer) The start date of the task.
  • tags: (OPTIONAL, string) The comma delimited list of tags.
  • uid: (OPTIONAL, string) A Unique Identifier for the task.
Return values
array<string|int, mixed>

array(ID,UID) of new task

delete()

Deletes a task and handles notification.

public delete(string $taskId) : mixed
Parameters
$taskId : string

The task to delete.

Return values
mixed

deleteAll()

Deletes all tasks for the current task list.

public deleteAll() : mixed
Tags
throws
Nag_Exception
Return values
mixed

get()

Retrieves one task from the database.

public get(string $taskId) : Nag_Task
Parameters
$taskId : string

The id of the task to retrieve.

Tags
throws
Nag_Exception
Return values
Nag_Task

A Nag_Task object.

getByUID()

Retrieves one or multiple tasks from the database by UID.

public getByUID(mixed $uids[, array<string|int, mixed> $tasklists = null ][, bool $getall = true ]) : Nag_Task
Parameters
$uids : mixed
$tasklists : array<string|int, mixed> = null

An optional array of tasklists to search.

$getall : bool = true

If true, return all instances of the task, otherwise only one. Attempts to find the instance owned by the current user.

Tags
throws
Horde_Exception_NotFound
throws
Nag_Exception
Return values
Nag_Task

A Nag_Task object.

getChildren()

Retrieves sub-tasks from the database.

public getChildren(string $parentId[, bool $include_history = true ]) : array<string|int, mixed>
Parameters
$parentId : string

The parent id for the sub-tasks to retrieve.

$include_history : bool = true

Include created/modified info?

Tags
throws
Nag_Exception
Return values
array<string|int, mixed>

List of sub-tasks.

listAlarms()

List all alarms near $date.

public listAlarms(int $date) : array<string|int, mixed>
Parameters
$date : int

The unix epoch time to check for alarms.

Return values
array<string|int, mixed>

An array of tasks that have alarms that match.

modify()

Modifies an existing task and handles notification.

public modify(string $taskId, array<string|int, mixed> $properties) : mixed
Parameters
$taskId : string

The task to modify.

$properties : array<string|int, mixed>

A hash with properties. @see add().

Tags
throws
Nag_Exception
Return values
mixed

open()

Sets the currently open tasklist.

public open(string $tasklist) : mixed
Parameters
$tasklist : string

The tasklist.

Return values
mixed

retrieve()

Retrieves tasks from the database.

public retrieve() : mixed
Tags
throws
Nag_Exception
Return values
mixed

synchronize()

Synchronize with the Kolab backend.

public synchronize([mixed $token = false ]) : mixed
Parameters
$token : mixed = false

A value indicating the last synchronization point, if available.

Return values
mixed

_add()

protected abstract _add(array<string|int, mixed> $task) : mixed
Parameters
$task : array<string|int, mixed>
Tags
see
add()
Return values
mixed

_addTags()

Helper function to add tags from a newly created event to the tagger.

protected _addTags(array<string|int, mixed> $task) : mixed
Parameters
$task : array<string|int, mixed>

The task to save tags to storage for.

Return values
mixed

_modify()

protected abstract _modify(mixed $taskId, array<string|int, mixed> $task) : mixed
Parameters
$taskId : mixed
$task : array<string|int, mixed>
Tags
see
modify()
Return values
mixed

_updateTags()

Helper function to update an existing event's tags to tagger storage.

protected _updateTags(array<string|int, mixed> $task) : mixed
Parameters
$task : array<string|int, mixed>

The task to update

Return values
mixed

Search results