PHP 클래스 Horde_Core_Tagger, horde

저자: Michael J Rubinsky ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_app string Application this tagger is for.
$_tagger Content_Tagger The tagger
$_type_ids array Cache of type name => ids from Content
$_types array The types handled by this tagger. The first entry in the array is taken as the default type if the type parameter is not specified in tagging methods.

공개 메소드들

메소드 설명
__construct ( ) Constructor.
browseTags ( array $tags, string $user ) : array Retrieve a set of tags that are related to the specifed set. A tag is related if resources tagged with the specified set are also tagged with the tag being considered. Used to "browse" tagged resources.
getCloud ( string $user, integer $limit = 5, boolean $all = false ) : array Returns the data needed to build a tag cloud based on the passed in user's tag data set.
getTagCountsByObjects ( array $ids, integer $type = null ) : array Get the number of times tags are used within a specific set of objects basically a tag cloud, restricted to objects of a specific type.
getTagIds ( string | array $tags ) : array Get tag ids for the specified tag names.
getTagInfo ( array $tags = null, integer $limit = 500, string $type = null, string $user = null ) : array Returns cloud-like information, but only for a specified set of tags.
getTags ( mixed $localId, string $type = null ) : array Retrieves the tags on given object(s).
listTags ( string $token ) : array Returns tags belonging to the current user beginning with $token.
replaceTags ( string $localId, mixed $tags, string $owner, string $content_type = null ) Tags the given resource with *only* the tags provided, removing any tags that are already present but not in the list.
search ( array $tags, array $filter = [] ) : array Searches for resources that are tagged with all of the requested tags.
split ( string $tags ) : array Split a tag string into an array of tags.
tag ( string $localId, mixed $tags, string $owner, string $content_type = null ) Tags an object with any number of tags.
untag ( string $localId, mixed $tags, string $content_type = null ) Removes a tag from an object.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( )

browseTags() 공개 메소드

Retrieve a set of tags that are related to the specifed set. A tag is related if resources tagged with the specified set are also tagged with the tag being considered. Used to "browse" tagged resources.
public browseTags ( array $tags, string $user ) : array
$tags array An array of tags to check. This would represent the current "directory" of tags while browsing.
$user string The resource must be owned by this user.
리턴 array A tag_id => tag_name hash.

getCloud() 공개 메소드

Returns the data needed to build a tag cloud based on the passed in user's tag data set.
public getCloud ( string $user, integer $limit = 5, boolean $all = false ) : array
$user string The user whose tags should be included.
$limit integer The maximum number of tags to include.
$all boolean Return all tags, not just tags for the current types.
리턴 array An array of hashes, each containing tag_id, tag_name, and count.

getTagCountsByObjects() 공개 메소드

Get the number of times tags are used within a specific set of objects basically a tag cloud, restricted to objects of a specific type.
public getTagCountsByObjects ( array $ids, integer $type = null ) : array
$ids array An array of local object ids.
$type integer The type identifier of of the objects.
리턴 array An array of tag_ids => counts.

getTagIds() 공개 메소드

Get tag ids for the specified tag names.
public getTagIds ( string | array $tags ) : array
$tags string | array Either a tag_name or array of tag_names.
리턴 array A tag_id => tag_name hash.

getTagInfo() 공개 메소드

Returns cloud-like information, but only for a specified set of tags.
public getTagInfo ( array $tags = null, integer $limit = 500, string $type = null, string $user = null ) : array
$tags array An array of either tag names or ids.
$limit integer Limit results to this many.
$type string The type of resource.
$user string Restrict results to those tagged by $user.
리턴 array An array of hashes, tag_id, tag_name, and count.

getTags() 공개 메소드

Retrieves the tags on given object(s).
public getTags ( mixed $localId, string $type = null ) : array
$localId mixed Either the identifier of the object or an array of identifiers.
$type string The type of object $localId represents.
리턴 array A tag_id => tag_name hash, possibly wrapped in a localid hash.

listTags() 공개 메소드

Used for autocomplete code.
public listTags ( string $token ) : array
$token string The token to match the start of the tag with.
리턴 array A tag_id => tag_name hash

replaceTags() 공개 메소드

Tags the given resource with *only* the tags provided, removing any tags that are already present but not in the list.
public replaceTags ( string $localId, mixed $tags, string $owner, string $content_type = null )
$localId string The identifier for the object.
$tags mixed Either a tag_id, tag_name, or array of tag_ids.
$owner string The tag owner - should normally be the resource owner.
$content_type string The type of object that $localId represents.

split() 공개 메소드

Overides Content_Tagger::split to only split on commas.
public split ( string $tags ) : array
$tags string A string of tags to be split.
리턴 array The split tags.

tag() 공개 메소드

Tags an object with any number of tags.
public tag ( string $localId, mixed $tags, string $owner, string $content_type = null )
$localId string The identifier of the object.
$tags mixed Either a single tag string or an array of tags.
$owner string The tag owner (should normally be the owner of the resource).
$content_type string The type of object we are tagging.

untag() 공개 메소드

Removes *all* tags - regardless of the user that added the tag.
public untag ( string $localId, mixed $tags, string $content_type = null )
$localId string The object identifier.
$tags mixed Either a tag_id, tag_name or an array of ids or names to remove.
$content_type string The type of object that $localId represents.

프로퍼티 상세

$_app 보호되어 있는 프로퍼티

Application this tagger is for.
protected string $_app
리턴 string

$_tagger 보호되어 있는 프로퍼티

The tagger
protected Content_Tagger $_tagger
리턴 Content_Tagger

$_type_ids 보호되어 있는 프로퍼티

Cache of type name => ids from Content
protected array $_type_ids
리턴 array

$_types 보호되어 있는 프로퍼티

The types handled by this tagger. The first entry in the array is taken as the default type if the type parameter is not specified in tagging methods.
protected array $_types
리턴 array