PHP Class IMP_Search, horde

Author: Michael Slusarz ([email protected])
Inheritance: implements ArrayAccess, implements IteratorAggregate, implements Serializable
Show file Open project: horde/horde

Public Properties

Property Type Description
$changed boolean Has the object data changed?

Protected Properties

Property Type Description
$_search array Each subarray contains: Keys: mailbox IDs. Values: IMP_Search_Query objects.

Public Methods

Method Description
__construct ( ) Constructor.
applyFilter ( string $id, array $mboxes, string $mid = null ) : IMP_Search_Query Converts a filter to a search query and stores it in the local session.
createQuery ( array $criteria, array $opts = [] ) : IMP_Search_Query Creates the IMAP search query.
createSearchId ( string $id ) : string Create the canonical search ID for a given search query.
editUrl ( string $id ) : Horde_Url Returns a link to edit a given search query.
getIterator ( )
init ( ) Initialize session search data.
isFilter ( string $id, boolean $editable = false ) Is a mailbox a filter query?
isQuery ( string $id, boolean $editable = false ) : boolean Is a mailbox a search query?
isSearchMbox ( string $id ) : boolean Is the given mailbox a search mailbox?
isSystemQuery ( string $id ) : boolean Is a mailbox a system (built-in) search query?
isVFolder ( string $id, boolean $editable = false ) : boolean Is a mailbox a virtual folder?
isVTrash ( string $id ) : boolean Determines whether a mailbox ID is the Virtual Trash Folder.
isVinbox ( string $id ) : boolean Determines whether a mailbox ID is the Virtual INBOX Folder.
offsetExists ( $offset ) * ArrayAccess methods.
offsetGet ( $offset )
offsetSet ( string $offset, IMP_Search_Query $value ) Alter the current IMAP search query.
offsetUnset ( string $offset ) Deletes an IMAP search query.
serialize ( ) : string Serialize.
setFilters ( array $filters ) Saves the list of filters for the current user.
setVFolders ( array $vfolders ) Saves the list of virtual folders for the current user.
unserialize ( string $data ) Unserialize.

Protected Methods

Method Description
_getFilters ( ) Loads the list of filters for the current user.
_getVFolders ( ) Loads the list of virtual folders for the current user.
_strip ( string $id ) : string Strip the identifying label from a mailbox ID.

Method Details

__construct() public method

Constructor.
public __construct ( )

_getFilters() protected method

Loads the list of filters for the current user.
protected _getFilters ( )

_getVFolders() protected method

Loads the list of virtual folders for the current user.
protected _getVFolders ( )

_strip() protected method

Strip the identifying label from a mailbox ID.
protected _strip ( string $id ) : string
$id string The mailbox query ID.
return string The virtual folder ID, with any IMP specific identifying information stripped off.

applyFilter() public method

Converts a filter to a search query and stores it in the local session.
public applyFilter ( string $id, array $mboxes, string $mid = null ) : IMP_Search_Query
$id string The mailbox ID of the filter.
$mboxes array The list of mailboxes to apply the filter on.
$mid string Use as the mailbox ID.
return IMP_Search_Query The created query object.

createQuery() public method

Creates the IMAP search query.
public createQuery ( array $criteria, array $opts = [] ) : IMP_Search_Query
$criteria array The search criteria array.
$opts 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.
return IMP_Search_Query Returns the query object.

createSearchId() public method

Create the canonical search ID for a given search query.
public createSearchId ( string $id ) : string
$id string The mailbox query ID.
return string The canonical search query ID.

editUrl() public method

Returns a link to edit a given search query.
public editUrl ( string $id ) : Horde_Url
$id string The search query id.
return Horde_Url The URL to the search page.

getIterator() public method

public getIterator ( )

init() public method

Initialize session search data.
public init ( )

isFilter() public method

Is a mailbox a filter query?
public isFilter ( string $id, boolean $editable = false )
$id string The mailbox ID.
$editable boolean Is this an editable (i.e. not built-in) filter query?

isQuery() public method

Is a mailbox a search query?
public isQuery ( string $id, boolean $editable = false ) : boolean
$id string The mailbox ID.
$editable boolean Is this an editable (i.e. not built-in) search query?
return boolean True if a search query.

isSearchMbox() public method

Is the given mailbox a search mailbox?
public isSearchMbox ( string $id ) : boolean
$id string The mailbox name.
return boolean Whether the given mailbox name is a search mailbox.

isSystemQuery() public method

Is a mailbox a system (built-in) search query?
public isSystemQuery ( string $id ) : boolean
$id string The mailbox ID.
return boolean True if a system search query.

isVFolder() public method

Is a mailbox a virtual folder?
public isVFolder ( string $id, boolean $editable = false ) : boolean
$id string The mailbox ID.
$editable boolean Is this an editable (i.e. not built-in) virtual folder?
return boolean Whether the mailbox ID is a virtual folder.

isVTrash() public method

Determines whether a mailbox ID is the Virtual Trash Folder.
public isVTrash ( string $id ) : boolean
$id string The mailbox id.
return boolean True if the ID is the Virtual Trash folder.

isVinbox() public method

Determines whether a mailbox ID is the Virtual INBOX Folder.
public isVinbox ( string $id ) : boolean
$id string The mailbox id.
return boolean True if the ID is the Virtual INBOX folder.

offsetExists() public method

* ArrayAccess methods.
public offsetExists ( $offset )

offsetGet() public method

public offsetGet ( $offset )

offsetSet() public method

Alter the current IMAP search query.
public offsetSet ( string $offset, IMP_Search_Query $value )
$offset string The search query id.
$value IMP_Search_Query The query object.

offsetUnset() public method

Deletes an IMAP search query.
public offsetUnset ( string $offset )
$offset string The search query id.

serialize() public method

Serialize.
public serialize ( ) : string
return string Serialized representation of this object.

setFilters() public method

Saves the list of filters for the current user.
public setFilters ( array $filters )
$filters array The filter list.

setVFolders() public method

Saves the list of virtual folders for the current user.
public setVFolders ( array $vfolders )
$vfolders array The virtual folder list.

unserialize() public method

Unserialize.
public unserialize ( string $data )
$data string Serialized data.

Property Details

$changed public property

Has the object data changed?
public bool $changed
return boolean