Class Nag_Driver

Description

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

$Horde: nag/lib/Driver.php,v 1.57.2.30 2009/10/15 16:23:26 jan Exp $

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.fsf.org/copyleft/gpl.html.

Located in /lib/Driver.php (line 15)


	
			
Direct descendents
Class Description
 class Nag_Driver_sql Nag storage implementation for PHP's PEAR database abstraction layer.
 class Nag_Driver_kolab Nag driver proxy class for the Kolab IMAP server.
Variable Summary
Method Summary
 Nag_Driver Nag_Driver ([array $params = array()], [ $errormsg = null])
 array add (string $name, string $desc, [integer $start = 0], [integer $due = 0], [integer $priority = 0], [float $estimate = 0.0], [integer $completed = 0], [string $category = ''], [integer $alarm = 0], [string $uid = null], [string $parent = ''], [boolean $private = false], [string $owner = null], [string $assignee = null])
 void delete (string $taskId)
 mixed &factory ([string $tasklist = ''], [string $driver = null], [array $params = null])
 string generateUID ()
 Nag_Task get (string $taskId)
 Nag_Task getByUID (string $uid)
 array getChildren (string $parentId)
 array listAlarms (integer $date)
 void modify (string $taskId, string $name, string $desc, [integer $start = 0], [integer $due = 0], [integer $priority = 0], [float $estimate = 0.0], [integer $completed = 0], [string $category = ''], [integer $alarm = 0], [string $parent = ''], [boolean $private = false], [string $owner = null], [string $assignee = null], [integer $completed_date = null], [string $tasklist = null])
 mixed retrieve ()
 mixed &singleton ([string $tasklist = ''], [string $driver = null], [array $params = null])
Variables
Nag_Task $tasks (line 22)

A Nag_Task instance holding the current task list.

string $_errormsg (line 43)

An error message to throw when something is wrong.

array $_params = array() (line 36)

Hash containing connection parameters.

string $_tasklist = '' (line 29)

String containing the current tasklist.

Methods
Constructor Nag_Driver (line 51)

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

Nag_Driver Nag_Driver ([array $params = array()], [ $errormsg = null])
  • array $params: Any parameters needed for this driver.
  • $errormsg
add (line 210)

Adds a task and handles notification.

  • return: array(ID,UID) of new task
array add (string $name, string $desc, [integer $start = 0], [integer $due = 0], [integer $priority = 0], [float $estimate = 0.0], [integer $completed = 0], [string $category = ''], [integer $alarm = 0], [string $uid = null], [string $parent = ''], [boolean $private = false], [string $owner = null], [string $assignee = null])
  • string $name: The name (short) of the task.
  • string $desc: The description (long) of the task.
  • integer $start: The start date of the task.
  • integer $due: The due date of the task.
  • integer $priority: The priority of the task.
  • float $estimate: The estimated time to complete the task.
  • integer $completed: The completion state of the task.
  • string $category: The category of the task.
  • integer $alarm: The alarm associated with the task.
  • string $uid: A Unique Identifier for the task.
  • string $parent: The parent task.
  • boolean $private: Whether the task is private.
  • string $owner: The owner of the event.
  • string $assignee: The assignee of the event.
delete (line 389)

Deletes a task and handles notification.

void delete (string $taskId)
  • string $taskId: The task to delete.
factory (line 119)

Attempts to return a concrete Nag_Driver instance based on $driver.

  • return: The newly created concrete Nag_Driver instance, or false on an error.
mixed &factory ([string $tasklist = ''], [string $driver = null], [array $params = null])
  • string $tasklist: The name of the tasklist to load.
  • string $driver: The type of concrete Nag_Driver subclass to return. The is based on the storage driver ($driver). The code is dynamically included.
  • array $params: (optional) A hash containing any additional configuration or connection parameters a subclass might need.
generateUID (line 95)

Generate a universal / unique identifier for a task. This is NOT something that we expect to be able to parse into a tasklist and a taskId.

  • return: A nice unique string (should be 255 chars or less).
string generateUID ()
get (line 451)

Retrieves one task from the database.

  • return: A Nag_Task object.
Nag_Task get (string $taskId)
  • string $taskId: The id of the task to retrieve.

Redefined in descendants as:
getByUID (line 463)

Retrieves one task from the database by UID.

  • return: A Nag_Task object.
Nag_Task getByUID (string $uid)
  • string $uid: The UID of the task to retrieve.

Redefined in descendants as:
getChildren (line 439)

Retrieves sub-tasks from the database.

  • return: List of sub-tasks.
array getChildren (string $parentId)
  • string $parentId: The parent id for the sub-tasks to retrieve.

Redefined in descendants as:
listAlarms (line 69)

List all alarms near $date.

  • return: An array of tasks that have alarms that match.
array listAlarms (integer $date)
  • integer $date: The unix epoch time to check for alarms.

Redefined in descendants as:
modify (line 279)

Modifies an existing task and handles notification.

void modify (string $taskId, string $name, string $desc, [integer $start = 0], [integer $due = 0], [integer $priority = 0], [float $estimate = 0.0], [integer $completed = 0], [string $category = ''], [integer $alarm = 0], [string $parent = ''], [boolean $private = false], [string $owner = null], [string $assignee = null], [integer $completed_date = null], [string $tasklist = null])
  • string $taskId: The task to modify.
  • string $name: The name (short) of the task.
  • string $desc: The description (long) of the task.
  • integer $start: The start date of the task.
  • integer $due: The due date of the task.
  • integer $priority: The priority of the task.
  • float $estimate: The estimated time to complete the task.
  • integer $completed: The completion state of the task.
  • string $category: The category of the task.
  • integer $alarm: The alarm associated with the task.
  • string $parent: The parent task.
  • boolean $private: Whether the task is private.
  • string $owner: The owner of the event.
  • string $assignee: The assignee of the event.
  • integer $completed_date: The task's completion date.
  • string $tasklist: The new tasklist.
retrieve (line 427)

Retrieves tasks from the database.

  • return: True on success, PEAR_Error on failure.
mixed retrieve ()

Redefined in descendants as:
singleton (line 170)

Attempts to return a reference to a concrete Nag_Driver instance based on $driver. It will only create a new instance if no Nag_Driver instance with the same parameters currently exists.

This should be used if multiple storage sources are required.

This method must be invoked as: $var =& Nag_Driver::singleton()

  • return: The created concrete Nag_Driver instance, or false on error.
mixed &singleton ([string $tasklist = ''], [string $driver = null], [array $params = null])
  • string $tasklist: The name of the tasklist to load.
  • string $driver: The type of concrete Nag_Driver subclass to return. The is based on the storage driver ($driver). The code is dynamically included.
  • array $params: (optional) A hash containing any additional configuration or connection parameters a subclass might need.

Documentation generated on Sun, 30 Jan 2011 05:35:02 +0000 by phpDocumentor 1.4.3