PHP Класс Horde_Core_TagBrowser, horde

Copyright 2011-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Автор: Michael J Rubinsky ([email protected])
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_app string The application this browser is for.
$_dirty boolean Dirty flag
$_owner string The user whose resources we are searching.
$_results array Results cache. Holds the results of the current search.
$_tagger Horde_Core_Tagger The Tagger object.
$_tags array Tags are always added to the search by name and stored by name=>id.
$_totalCount integer Total count of matches.

Открытые методы

Метод Описание
__construct ( Horde_Core_Tagger $tagger, array $tags = null, string $owner = null ) Const'r
addTag ( string $tag ) Add a tag to the cumulative tag search
clearSearch ( ) Clears the session cache of tags currently included in the search.
count ( ) : integer Get the total number of resources that match.
getRelatedTags ( array $default_results = null ) : array Get a list of tags related to this search. Concrete tagger classes can override the _getRelatedTagsWith* methods if they can perform them more efficiently.
getSlice ( integer $page, integer $perpage = null ) : array Fetch the matching resources that should appear on the current page
getTagTrail ( ) : Return Get breadcrumb style navigation html for choosen tags
getTags ( ) : array Get the list of currently choosen tags
removeTag ( string $tag ) Remove a tag from the cumulative search
runSearch ( ) Perform, and cache the search.
save ( ) Saves current state to the session.
tagCount ( ) : integer Get the total number of tags included in this search.

Защищенные методы

Метод Описание
_getRelatedTagsWithNoResults ( ) : array Default implementation for getting related tags when we don't have any current search in effect. This is very inefficent and should only be used as a very last resort. Better to have concrete classes provide the full result set. See _getRelatedTagsWithResults().
_getRelatedTagsWithResults ( array $default_results = null ) : array Default implementation for getRelatedTags
_runSearch ( ) : array Default implementation for runSearch.
_sortTagInfo ( $a, $b ) Helper for uasort. Sorts the results by count.

Описание методов

__construct() публичный Метод

Const'r
public __construct ( Horde_Core_Tagger $tagger, array $tags = null, string $owner = null )
$tagger Horde_Core_Tagger The tagger object.
$tags array Tags to add to initially search on.
$owner string Restrict to resources owned by owner.

_getRelatedTagsWithNoResults() защищенный Метод

Default implementation for getting related tags when we don't have any current search in effect. This is very inefficent and should only be used as a very last resort. Better to have concrete classes provide the full result set. See _getRelatedTagsWithResults().
protected _getRelatedTagsWithNoResults ( ) : array
Результат array An array of tag_id => [tag_name, total]

_getRelatedTagsWithResults() защищенный Метод

Default implementation for getRelatedTags
protected _getRelatedTagsWithResults ( array $default_results = null ) : array
$default_results array A default list of object ids to use to fetch tags from. Used when the current search results are empty.
Результат array An array of tag_id => [tag_name, total].

_runSearch() защищенный Метод

Default implementation for runSearch.
protected _runSearch ( ) : array
Результат array An array of search results. Either a one dimensional array containing local object uids, or a multi dimensional array of object_type => array_of_uids, ....

_sortTagInfo() защищенный Метод

Helper for uasort. Sorts the results by count.
protected _sortTagInfo ( $a, $b )

addTag() публичный Метод

Add a tag to the cumulative tag search
public addTag ( string $tag )
$tag string The tag name to add.

clearSearch() публичный Метод

Clears the session cache of tags currently included in the search.
public clearSearch ( )

count() публичный Метод

Get the total number of resources that match.
public count ( ) : integer
Результат integer The count of matching resources.

getRelatedTags() публичный Метод

Get a list of tags related to this search. Concrete tagger classes can override the _getRelatedTagsWith* methods if they can perform them more efficiently.
public getRelatedTags ( array $default_results = null ) : array
$default_results array A default list of object ids to use to fetch tags from. Used when the current search results are empty.
Результат array An array tag_id => {tag_name, total}

getSlice() абстрактный публичный Метод

Fetch the matching resources that should appear on the current page
abstract public getSlice ( integer $page, integer $perpage = null ) : array
$page integer The page to get slice for.
$perpage integer The number of objects per page.
Результат array An array of result objects.

getTagTrail() абстрактный публичный Метод

Get breadcrumb style navigation html for choosen tags
abstract public getTagTrail ( ) : Return
Результат Return information useful for building a tag trail.

getTags() публичный Метод

Get the list of currently choosen tags
public getTags ( ) : array
Результат array A hash of the currently selected tag_name => tag_id.

removeTag() публичный Метод

Remove a tag from the cumulative search
public removeTag ( string $tag )
$tag string The tag name to remove.

runSearch() публичный Метод

Perform, and cache the search.
public runSearch ( )

save() публичный Метод

Saves current state to the session.
public save ( )

tagCount() публичный Метод

Get the total number of tags included in this search.
public tagCount ( ) : integer
Результат integer The number of tags used in the current search.

Описание свойств

$_app защищенное свойство

The application this browser is for.
protected string $_app
Результат string

$_dirty защищенное свойство

Dirty flag
protected bool $_dirty
Результат boolean

$_owner защищенное свойство

The user whose resources we are searching.
protected string $_owner
Результат string

$_results защищенное свойство

Results cache. Holds the results of the current search.
protected array $_results
Результат array

$_tagger защищенное свойство

The Tagger object.
protected Horde_Core_Tagger $_tagger
Результат Horde_Core_Tagger

$_tags защищенное свойство

Tags are always added to the search by name and stored by name=>id.
protected array $_tags
Результат array

$_totalCount защищенное свойство

Total count of matches.
protected int $_totalCount
Результат integer