\Nag_Driver_Smartlist

Nag storage driver for handling smart tasklists.

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

Summary

Methods
Properties
Constants
__construct()
listAlarms()
open()
add()
modify()
_modify()
delete()
deleteAll()
retrieve()
getChildren()
get()
getByUID()
synchronize()
_deleteAll()
$tasks
No constants found
_add()
_updateTags()
_addTags()
_delete()
$_tasklist
$_params
$_errormsg
$_driver
$_share
$_search
N/A
No private methods found
No private properties found
N/A

Properties

$tasks

$tasks : \Nag_Task

A Nag_Task instance holding the current task list.

Type

\Nag_Task

$_tasklist

$_tasklist : string

String containing the current tasklist.

Type

string

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_errormsg

$_errormsg : string

An error message to throw when something is wrong.

Type

string

$_driver

$_driver : \Nag_Driver

The composed Nag_Driver

Type

\Nag_Driver

$_share

$_share : \Horde_Share_Object

The share object the smartlist is based on.

Type

\Horde_Share_Object

$_search

$_search : \Nag_Search

The search query bulding this smartlist.

Type

\Nag_Search

Methods

__construct()

__construct(string  $tasklist, array  $params = array()) : \Nag_Driver

Constructs a new SQL storage object.

Parameters

string $tasklist

The tasklist to load.

array $params

A hash containing connection parameters.

Returns

\Nag_Driver

listAlarms()

listAlarms(integer  $date) : array

List all alarms near $date.

Parameters

integer $date

The unix epoch time to check for alarms.

Returns

array —

An array of tasks that have alarms that match.

open()

open(string  $tasklist) 

Sets the currently open tasklist.

Parameters

string $tasklist

The tasklist.

add()

add(array  $task) : array

Adds a task and handles notification.

Parameters

array $task

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.

Returns

array —

array(ID,UID) of new task

modify()

modify(string  $taskId, array  $task) 

Modifies an existing task and handles notification.

Parameters

string $taskId

The task to modify.

array $task

_modify()

_modify(  $taskId, array  $task) 

Parameters

$taskId
array $task

delete()

delete(string  $taskId) 

Deletes a task and handles notification.

Parameters

string $taskId

The task to delete.

deleteAll()

deleteAll() 

Deletes all tasks for the current task list.

retrieve()

retrieve() 

Return the list of tasks that match this smart list's search criteria.

getChildren()

getChildren(string  $parentId, boolean  $include_history = true) : array

Retrieves sub-tasks from the database.

Parameters

string $parentId

The parent id for the sub-tasks to retrieve.

boolean $include_history

Include created/modified info?

Returns

array —

List of sub-tasks.

get()

get(string  $taskId) : \Nag_Task

Retrieves one task from the database.

Parameters

string $taskId

The id of the task to retrieve.

Returns

\Nag_Task

A Nag_Task object.

getByUID()

getByUID(  $uids, array  $tasklists = null, boolean  $getall = true) : \Nag_Task

Retrieves one or multiple tasks from the database by UID.

Parameters

$uids
array $tasklists

An optional array of tasklists to search.

boolean $getall

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

Throws

\Horde_Exception_NotFound
\Nag_Exception

Returns

\Nag_Task

A Nag_Task object.

synchronize()

synchronize(mixed  $token = false) 

Synchronize with the Kolab backend.

Parameters

mixed $token

A value indicating the last synchronization point, if available.

_deleteAll()

_deleteAll() 

_add()

_add(array  $task) 

Needed to satisfy the abstract parent class.

Parameters

array $task

_updateTags()

_updateTags(array  $task) 

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

Parameters

array $task

The task to update

_addTags()

_addTags(array  $task) 

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

Parameters

array $task

The task to save tags to storage for.

_delete()

_delete(  $taskId) 

Parameters

$taskId