PHP Класс Nag_Driver, horde

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Автор: Jon Parise ([email protected])
Автор: Jan Schneider ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$tasks Nag_Task A Nag_Task instance holding the current task list.

Защищенные свойства (Protected)

Свойство Тип Описание
$_errormsg string An error message to throw when something is wrong.
$_params array Hash containing connection parameters.
$_tasklist string String containing the current tasklist.

Открытые методы

Метод Описание
__construct ( array $params = [], string $errormsg = null ) : Nag_Driver Constructor - just store the $params in our newly-created object. All other work is done by initialize().
add ( array $task ) : array Adds a task and handles notification.
delete ( string $taskId ) Deletes a task and handles notification.
deleteAll ( ) Deletes all tasks for the current task list.
get ( string $taskId ) : Nag_Task Retrieves one task from the database.
getByUID ( $uids, array $tasklists = null, boolean $getall = true ) : Nag_Task Retrieves one or multiple tasks from the database by UID.
getChildren ( string $parentId, boolean $include_history = true ) : array Retrieves sub-tasks from the database.
listAlarms ( integer $date ) : array List all alarms near $date.
modify ( string $taskId, array $properties ) Modifies an existing task and handles notification.
open ( string $tasklist ) Sets the currently open tasklist.
retrieve ( ) Retrieves tasks from the database.
synchronize ( mixed $token = false ) Synchronize with the Kolab backend.

Защищенные методы

Метод Описание
_add ( array $task )
_addTags ( array $task ) Helper function to add tags from a newly created event to the tagger.
_modify ( $taskId, array $task )
_updateTags ( array $task ) Helper function to update an existing event's tags to tagger storage.

Описание методов

__construct() публичный Метод

Constructor - just store the $params in our newly-created object. All other work is done by initialize().
public __construct ( array $params = [], string $errormsg = null ) : Nag_Driver
$params array Any parameters needed for this driver.
$errormsg string Custom error message
Результат Nag_Driver

_add() абстрактный защищенный Метод

См. также: add()
abstract protected _add ( array $task )
$task array

_addTags() защищенный Метод

Helper function to add tags from a newly created event to the tagger.
protected _addTags ( array $task )
$task array The task to save tags to storage for.

_modify() абстрактный защищенный Метод

См. также: modify()
abstract protected _modify ( $taskId, array $task )
$task array

_updateTags() защищенный Метод

Helper function to update an existing event's tags to tagger storage.
protected _updateTags ( array $task )
$task array The task to update

add() публичный Метод

Adds a task and handles notification.
public add ( array $task ) : array
$task array 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.
Результат array array(ID,UID) of new task

delete() публичный Метод

Deletes a task and handles notification.
public delete ( string $taskId )
$taskId string The task to delete.

deleteAll() публичный Метод

Deletes all tasks for the current task list.
public deleteAll ( )

get() публичный Метод

Retrieves one task from the database.
public get ( string $taskId ) : Nag_Task
$taskId string The id of the task to retrieve.
Результат Nag_Task A Nag_Task object.

getByUID() публичный Метод

Retrieves one or multiple tasks from the database by UID.
public getByUID ( $uids, array $tasklists = null, boolean $getall = true ) : Nag_Task
$tasklists array An optional array of tasklists to search.
$getall boolean If true, return all instances of the task, otherwise only one. Attempts to find the instance owned by the current user.
Результат Nag_Task A Nag_Task object.

getChildren() публичный Метод

Retrieves sub-tasks from the database.
public getChildren ( string $parentId, boolean $include_history = true ) : array
$parentId string The parent id for the sub-tasks to retrieve.
$include_history boolean Include created/modified info?
Результат array List of sub-tasks.

listAlarms() публичный Метод

List all alarms near $date.
public listAlarms ( integer $date ) : array
$date integer The unix epoch time to check for alarms.
Результат array An array of tasks that have alarms that match.

modify() публичный Метод

Modifies an existing task and handles notification.
public modify ( string $taskId, array $properties )
$taskId string The task to modify.
$properties array A hash with properties. @see add().

open() публичный Метод

Sets the currently open tasklist.
public open ( string $tasklist )
$tasklist string The tasklist.

retrieve() публичный Метод

Retrieves tasks from the database.
public retrieve ( )

synchronize() публичный Метод

Synchronize with the Kolab backend.
public synchronize ( mixed $token = false )
$token mixed A value indicating the last synchronization point, if available.

Описание свойств

$_errormsg защищенное свойство

An error message to throw when something is wrong.
protected string $_errormsg
Результат string

$_params защищенное свойство

Hash containing connection parameters.
protected array $_params
Результат array

$_tasklist защищенное свойство

String containing the current tasklist.
protected string $_tasklist
Результат string

$tasks публичное свойство

A Nag_Task instance holding the current task list.
public Nag_Task $tasks
Результат Nag_Task