Nag_Search
in package
implements
Serializable
Nag_Search:: Interface for performing task searches.
Copyright 2001-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (BSD). If you did not did not receive this file, see http://www.horde.org/licenses/bsdl.php.
Tags
Interfaces, Classes, Traits and Enums
- Serializable
Table of Contents
- MASK_ALL = 7
- MASK_DESC = 2
- MASK_NAME = 1
- Search bit masks
- MASK_TAGS = 4
- $_completed : int
- The completed/view value.
- $_due : array<string|int, mixed>
- Duedate criteria
- $_mask : int
- The search mask
- $_search : array<string|int, mixed>
- Search criteria
- $_tags : array<string|int, mixed>
- Tag search criteria
- $_tasklists : array<string|int, mixed>
- The tasks lists to search.
- __construct() : Nag_Search
- Constructor
- getSlice() : Nag_Task
- Get a result slice.
- getVars() : mixed
- Populate a Horde_Variables instance with the search values for this search.
- serialize() : array<string|int, mixed>
- Serialize method
- unserialize() : mixed
- Unserialize method
- _search() : Nag_Task
- Perform the search
Constants
MASK_ALL
public
mixed
MASK_ALL
= 7
MASK_DESC
public
mixed
MASK_DESC
= 2
MASK_NAME
Search bit masks
public
mixed
MASK_NAME
= 1
MASK_TAGS
public
mixed
MASK_TAGS
= 4
Properties
$_completed
The completed/view value.
protected
int
$_completed
$_due
Duedate criteria
protected
array<string|int, mixed>
$_due
$_mask
The search mask
protected
int
$_mask
$_search
Search criteria
protected
array<string|int, mixed>
$_search
$_tags
Tag search criteria
protected
array<string|int, mixed>
$_tags
$_tasklists
The tasks lists to search.
protected
array<string|int, mixed>
$_tasklists
Methods
__construct()
Constructor
public
__construct(string $search, int $mask[, array<string|int, mixed> $options = array() ]) : Nag_Search
Parameters
- $search : string
-
The search string.
- $mask : int
-
A bitmask to indicate the fields to search.
- $options : array<string|int, mixed> = array()
-
Additional options:
-
completed: (integer) Which tasks to include. A NAG::VIEW_* constant. DEFAULT: Nag::VIEW_INCOMPLETE
-
due: (array) An array describing the due date portion of the search. EXAMPLE: array('5', 'tomorrow') would be all tasks due within 5 days of tomorrow. DEFAULT: No date filters.
-
tags: (array) An array of tags to filter on.
-
tasklists: (array) An array of tasklist ids to filter on. DEFAULT: The current display_tasklists value is used.
-
Return values
Nag_Search —getSlice()
Get a result slice.
public
getSlice(int $page, int $perpage) : Nag_Task
Parameters
- $page : int
-
The page number
- $perpage : int
-
The number of results per page.
Return values
Nag_Task —The result list.
getVars()
Populate a Horde_Variables instance with the search values for this search.
public
getVars(Horde_Variables &$vars) : mixed
Parameters
- $vars : Horde_Variables
-
The Horde_Variables object.
Return values
mixed —serialize()
Serialize method
public
serialize() : array<string|int, mixed>
Return values
array<string|int, mixed> —The unserialized data.
unserialize()
Unserialize method
public
unserialize(string $data) : mixed
Parameters
- $data : string
-
The serialized data.
Return values
mixed —_search()
Perform the search
protected
_search(int $page, int $perpage) : Nag_Task
Parameters
- $page : int
-
The page number
- $perpage : int
-
The number of results per page.