Nag_Driver_Smartlist
extends Nag_Driver
in package
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.
Tags
Table of Contents
- $tasks : Nag_Task
- A Nag_Task instance holding the current task list.
- $_driver : Nag_Driver
- The composed Nag_Driver
- $_errormsg : string
- An error message to throw when something is wrong.
- $_params : array<string|int, mixed>
- Hash containing connection parameters.
- $_search : Nag_Search
- The search query bulding this smartlist.
- $_share : Horde_Share_Object
- The share object the smartlist is based on.
- $_tasklist : string
- String containing the current tasklist.
- __construct() : Nag_Driver
- Constructs a new SQL storage object.
- _deleteAll() : mixed
- _modify() : mixed
- 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
- Return the list of tasks that match this smart list's search criteria.
- synchronize() : mixed
- Synchronize with the Kolab backend.
- _add() : mixed
- Needed to satisfy the abstract parent class.
- _addTags() : mixed
- Helper function to add tags from a newly created event to the tagger.
- _delete() : 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
$_driver
The composed Nag_Driver
protected
Nag_Driver
$_driver
$_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()
$_search
The search query bulding this smartlist.
protected
Nag_Search
$_search
$_share
The share object the smartlist is based on.
protected
Horde_Share_Object
$_share
$_tasklist
String containing the current tasklist.
protected
string
$_tasklist
= ''
Methods
__construct()
Constructs a new SQL storage object.
public
__construct(string $tasklist[, array<string|int, mixed> $params = array() ]) : Nag_Driver
Parameters
- $tasklist : string
-
The tasklist to load.
- $params : array<string|int, mixed> = array()
-
A hash containing connection parameters.
Return values
Nag_Driver —_deleteAll()
public
_deleteAll() : mixed
Return values
mixed —_modify()
public
_modify(mixed $taskId, array<string|int, mixed> $task) : mixed
Parameters
- $taskId : mixed
- $task : array<string|int, mixed>
Return values
mixed —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(mixed $taskId) : mixed
Parameters
- $taskId : mixed
-
The task to delete.
Return values
mixed —deleteAll()
Deletes all tasks for the current task list.
public
deleteAll() : mixed
Tags
Return values
mixed —get()
Retrieves one task from the database.
public
get(mixed $taskId) : Nag_Task
Parameters
- $taskId : mixed
-
The id of the task to retrieve.
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
Return values
Nag_Task —A Nag_Task object.
getChildren()
Retrieves sub-tasks from the database.
public
getChildren(mixed $parentId[, mixed $include_history = true ]) : array<string|int, mixed>
Parameters
- $parentId : mixed
-
The parent id for the sub-tasks to retrieve.
- $include_history : mixed = true
-
Include created/modified info?
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(mixed $taskId, array<string|int, mixed> $task) : mixed
Parameters
- $taskId : mixed
-
The task to modify.
- $task : array<string|int, mixed>
Return values
mixed —open()
Sets the currently open tasklist.
public
open(string $tasklist) : mixed
Parameters
- $tasklist : string
-
The tasklist.
Return values
mixed —retrieve()
Return the list of tasks that match this smart list's search criteria.
public
retrieve() : mixed
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()
Needed to satisfy the abstract parent class.
protected
_add(array<string|int, mixed> $task) : mixed
Parameters
- $task : array<string|int, mixed>
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 —_delete()
protected
_delete(mixed $taskId) : mixed
Parameters
- $taskId : mixed
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