Nag_Driver:: defines an API for implementing storage backends for Nag.
See the enclosed file COPYING for license information (GPL). If you
did not receive this file, see http://www.horde.org/licenses/gpl.
Methods summary
public
Nag_Driver
|
#
__construct( array $params = array(), string $errormsg = null )
Constructor - just store the $params in our newly-created
object. All other work is done by initialize().
Constructor - just store the $params in our newly-created
object. All other work is done by initialize().
Parameters
- $params
- Any parameters needed for this driver.
- $errormsg
- Custom error message
Returns
|
public
array
|
#
listAlarms( integer $date )
List all alarms near $date.
List all alarms near $date.
Parameters
- $date
- The unix epoch time to check for alarms.
Returns
array An array of tasks that have alarms that match.
|
public static
mixed
|
#
factory( string $tasklist = '', string $driver = null, array $params = null )
Attempts to return a concrete Nag_Driver instance based on $driver.
Attempts to return a concrete Nag_Driver instance based on $driver.
Parameters
- $tasklist
- The name of the tasklist to load.
- $driver
- <p>The type of concrete Nag_Driver subclass
to return. The is based on the storage
driver ($driver). The code is dynamically
included.</p>
- $params
- <p>(optional) A hash containing any additional
configuration or connection parameters a
subclass might need.</p>
Returns
mixed The newly created concrete Nag_Driver instance, or
false on an error.
|
public static
mixed
&
|
#
singleton( string $tasklist = '', string $driver = null, array $params = null )
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.
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()
Parameters
- $tasklist
- The name of the tasklist to load.
- $driver
- <p>The type of concrete Nag_Driver subclass
to return. The is based on the storage
driver ($driver). The code is dynamically
included.</p>
- $params
- <p>(optional) A hash containing any additional
configuration or connection parameters a
subclass might need.</p>
Returns
mixed The created concrete Nag_Driver instance, or false
on error.
|
public
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, array $methods = null, string $uid = null, string $parent = '', boolean $private = false, string $owner = null, string $assignee = null )
Adds a task and handles notification.
Adds a task and handles notification.
Parameters
- $name
- The name (short) of the task.
- $desc
- The description (long) of the task.
- $start
- The start date of the task.
- $due
- The due date of the task.
- $priority
- The priority of the task.
- $estimate
- The estimated time to complete the task.
- $completed
- The completion state of the task.
- $category
- The category of the task.
- $alarm
- The alarm associated with the task.
- $methods
- The overridden alarm notification methods.
- $uid
- A Unique Identifier for the task.
- $parent
- The parent task.
- $private
- Whether the task is private.
- $owner
- The owner of the event.
- $assignee
- The assignee of the event.
Returns
array array(ID,UID) of new task
|
public
|
#
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, array $methods = null, string $parent = '', boolean $private = false, string $owner = null, string $assignee = null, integer $completed_date = null, string $tasklist = null )
Modifies an existing task and handles notification.
Modifies an existing task and handles notification.
Parameters
- $taskId
- The task to modify.
- $name
- The name (short) of the task.
- $desc
- The description (long) of the task.
- $start
- The start date of the task.
- $due
- The due date of the task.
- $priority
- The priority of the task.
- $estimate
- The estimated time to complete the task.
- $completed
- The completion state of the task.
- $category
- The category of the task.
- $alarm
- The alarm associated with the task.
- $methods
- <p>The overridden alarm notification
methods.</p>
- $parent
- The parent task.
- $private
- Whether the task is private.
- $owner
- The owner of the event.
- $assignee
- The assignee of the event.
- $completed_date
- The task's completion date.
- $tasklist
- The new tasklist.
Throws
|
public
|
#
delete( string $taskId )
Deletes a task and handles notification.
Deletes a task and handles notification.
Parameters
- $taskId
- The task to delete.
|
public
|
#
retrieve( )
Retrieves tasks from the database.
Retrieves tasks from the database.
Throws
|
public
array
|
#
getChildren( string $parentId )
Retrieves sub-tasks from the database.
Retrieves sub-tasks from the database.
Parameters
- $parentId
- The parent id for the sub-tasks to retrieve.
Returns
array List of sub-tasks.
Throws
|
public
Nag_Task
|
#
get( string $taskId )
Retrieves one task from the database.
Retrieves one task from the database.
Parameters
- $taskId
- The id of the task to retrieve.
Returns
Throws
|
public
Nag_Task
|
#
getByUID( string $uid )
Retrieves one task from the database by UID.
Retrieves one task from the database by UID.
Parameters
- $uid
- The UID of the task to retrieve.
Returns
Throws
|