IMP_Search
in package
implements
ArrayAccess, IteratorAggregate, Serializable
Object handling mailbox searching in IMP.
Tags
Table of Contents
Interfaces
- ArrayAccess
- IteratorAggregate
- Serializable
Constants
- CREATE_FILTER = 1
- CREATE_QUERY = 2
- CREATE_VFOLDER = 3
- FILTERSEARCH = 'impfsearch'
- MBOX_PREFIX = "impsearch\x00"
- QUICKSEARCH = 'impqsearch'
Properties
Methods
- __construct() : mixed
- Constructor.
- __serialize() : array<string|int, mixed>
- __unserialize() : void
- applyFilter() : IMP_Search_Query
- Converts a filter to a search query and stores it in the local session.
- createQuery() : IMP_Search_Query
- Creates the IMAP search query.
- createSearchId() : string
- Create the canonical search ID for a given search query.
- editUrl() : Horde_Url
- Returns a link to edit a given search query.
- getIterator() : Traversable
- init() : mixed
- Initialize session search data.
- isFilter() : mixed
- Is a mailbox a filter query?
- isQuery() : bool
- Is a mailbox a search query?
- isSearchMbox() : bool
- Is the given mailbox a search mailbox?
- isSystemQuery() : bool
- Is a mailbox a system (built-in) search query?
- isVFolder() : bool
- Is a mailbox a virtual folder?
- isVinbox() : bool
- Determines whether a mailbox ID is the Virtual INBOX Folder.
- isVTrash() : bool
- Determines whether a mailbox ID is the Virtual Trash Folder.
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : mixed
- Alter the current IMAP search query.
- offsetUnset() : mixed
- Deletes an IMAP search query.
- serialize() : string
- Serialize.
- setFilters() : mixed
- Saves the list of filters for the current user.
- setVFolders() : mixed
- Saves the list of virtual folders for the current user.
- unserialize() : mixed
- Unserialize.
- _getFilters() : mixed
- Loads the list of filters for the current user.
- _getVFolders() : mixed
- Loads the list of virtual folders for the current user.
- _strip() : string
- Strip the identifying label from a mailbox ID.
Constants
CREATE_FILTER
public
mixed
CREATE_FILTER
= 1
CREATE_QUERY
public
mixed
CREATE_QUERY
= 2
CREATE_VFOLDER
public
mixed
CREATE_VFOLDER
= 3
FILTERSEARCH
public
mixed
FILTERSEARCH
= 'impfsearch'
MBOX_PREFIX
public
mixed
MBOX_PREFIX
= "impsearch\x00"
QUICKSEARCH
public
mixed
QUICKSEARCH
= 'impqsearch'
Properties
$changed
Has the object data changed?
public
bool
$changed
= \false
$_search
Search queries.
protected
array<string|int, mixed>
$_search
= array('filters' => array(), 'query' => array(), 'vfolders' => array())
Each subarray contains: Keys: mailbox IDs. Values: IMP_Search_Query objects.
Methods
__construct()
Constructor.
public
__construct() : mixed
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
applyFilter()
Converts a filter to a search query and stores it in the local session.
public
applyFilter(string $id, array<string|int, mixed> $mboxes[, string $mid = null ]) : IMP_Search_Query
Parameters
- $id : string
-
The mailbox ID of the filter.
- $mboxes : array<string|int, mixed>
-
The list of mailboxes to apply the filter on.
- $mid : string = null
-
Use as the mailbox ID.
Tags
Return values
IMP_Search_Query —The created query object.
createQuery()
Creates the IMAP search query.
public
createQuery(array<string|int, mixed> $criteria[, array<string|int, mixed> $opts = array() ]) : IMP_Search_Query
Parameters
- $criteria : array<string|int, mixed>
-
The search criteria array.
- $opts : array<string|int, mixed> = array()
-
Additional options:
- id: (string) Use as the mailbox ID.
- label: (string) The label to use for the search results.
- mboxes: (array) The list of mailboxes to directly search. If this contains the IMP_Search_Query::ALLSEARCH constant, all mailboxes will be searched.
- subfolders: (array) The list of mailboxes to do subfolder searches on.
- type: (integer) Query type.
Tags
Return values
IMP_Search_Query —Returns the query object.
createSearchId()
Create the canonical search ID for a given search query.
public
createSearchId(string $id) : string
Parameters
- $id : string
-
The mailbox query ID.
Return values
string —The canonical search query ID.
editUrl()
Returns a link to edit a given search query.
public
editUrl(string $id) : Horde_Url
Parameters
- $id : string
-
The search query id.
Return values
Horde_Url —The URL to the search page.
getIterator()
public
getIterator() : Traversable
Return values
Traversableinit()
Initialize session search data.
public
init() : mixed
isFilter()
Is a mailbox a filter query?
public
isFilter(string $id[, bool $editable = false ]) : mixed
Parameters
- $id : string
-
The mailbox ID.
- $editable : bool = false
-
Is this an editable (i.e. not built-in) filter query?
isQuery()
Is a mailbox a search query?
public
isQuery(string $id[, bool $editable = false ]) : bool
Parameters
- $id : string
-
The mailbox ID.
- $editable : bool = false
-
Is this an editable (i.e. not built-in) search query?
Return values
bool —True if a search query.
isSearchMbox()
Is the given mailbox a search mailbox?
public
isSearchMbox(string $id) : bool
Parameters
- $id : string
-
The mailbox name.
Return values
bool —Whether the given mailbox name is a search mailbox.
isSystemQuery()
Is a mailbox a system (built-in) search query?
public
isSystemQuery(string $id) : bool
Parameters
- $id : string
-
The mailbox ID.
Return values
bool —True if a system search query.
isVFolder()
Is a mailbox a virtual folder?
public
isVFolder(string $id[, bool $editable = false ]) : bool
Parameters
- $id : string
-
The mailbox ID.
- $editable : bool = false
-
Is this an editable (i.e. not built-in) virtual folder?
Return values
bool —Whether the mailbox ID is a virtual folder.
isVinbox()
Determines whether a mailbox ID is the Virtual INBOX Folder.
public
isVinbox(string $id) : bool
Parameters
- $id : string
-
The mailbox id.
Return values
bool —True if the ID is the Virtual INBOX folder.
isVTrash()
Determines whether a mailbox ID is the Virtual Trash Folder.
public
isVTrash(string $id) : bool
Parameters
- $id : string
-
The mailbox id.
Return values
bool —True if the ID is the Virtual Trash folder.
offsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
Alter the current IMAP search query.
public
offsetSet(string $offset, IMP_Search_Query $value) : mixed
Parameters
- $offset : string
-
The search query id.
- $value : IMP_Search_Query
-
The query object.
Tags
offsetUnset()
Deletes an IMAP search query.
public
offsetUnset(string $offset) : mixed
Parameters
- $offset : string
-
The search query id.
serialize()
Serialize.
public
serialize() : string
Return values
string —Serialized representation of this object.
setFilters()
Saves the list of filters for the current user.
public
setFilters(array<string|int, mixed> $filters) : mixed
Parameters
- $filters : array<string|int, mixed>
-
The filter list.
setVFolders()
Saves the list of virtual folders for the current user.
public
setVFolders(array<string|int, mixed> $vfolders) : mixed
Parameters
- $vfolders : array<string|int, mixed>
-
The virtual folder list.
unserialize()
Unserialize.
public
unserialize(string $data) : mixed
Parameters
- $data : string
-
Serialized data.
Tags
_getFilters()
Loads the list of filters for the current user.
protected
_getFilters() : mixed
_getVFolders()
Loads the list of virtual folders for the current user.
protected
_getVFolders() : mixed
_strip()
Strip the identifying label from a mailbox ID.
protected
_strip(string $id) : string
Parameters
- $id : string
-
The mailbox query ID.
Return values
string —The virtual folder ID, with any IMP specific identifying information stripped off.