Horde_Core_Tagger_Null
extends Horde_Core_Tagger
in package
Null driver for the Horde_Content tagger.
Tags
Table of Contents
Properties
- $_app : string
- Application this tagger is for.
- $_tagger : Content_Tagger
- The tagger
- $_type_ids : array<string|int, mixed>
- Cache of type name => ids from Content
- $_types : array<string|int, mixed>
- 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.
Methods
- __construct() : mixed
- Constructor.
- browseTags() : array<string|int, mixed>
- 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() : array<string|int, mixed>
- Returns the data needed to build a tag cloud based on the passed in user's tag data set.
- getTagCountsByObjects() : array<string|int, mixed>
- 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() : array<string|int, mixed>
- Get tag ids for the specified tag names.
- getTagInfo() : array<string|int, mixed>
- Returns cloud-like information, but only for a specified set of tags.
- getTags() : array<string|int, mixed>
- Retrieves the tags on given object(s).
- listTags() : array<string|int, mixed>
- Returns tags belonging to the current user beginning with $token.
- replaceTags() : mixed
- Tags the given resource with *only* the tags provided, removing any tags that are already present but not in the list.
- search() : array<string|int, mixed>
- Searches for resources that are tagged with all of the requested tags.
- split() : array<string|int, mixed>
- Split a tag string into an array of tags.
- tag() : mixed
- Tags an object with any number of tags.
- untag() : mixed
- Removes a tag from an object.
Properties
$_app
Application this tagger is for.
protected
string
$_app
$_tagger
The tagger
protected
Content_Tagger
$_tagger
$_type_ids
Cache of type name => ids from Content
protected
array<string|int, mixed>
$_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<string|int, mixed>
$_types
Methods
__construct()
Constructor.
public
__construct() : mixed
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(mixed $tags, mixed $user) : array<string|int, mixed>
Parameters
- $tags : mixed
-
An array of tags to check. This would represent the current "directory" of tags while browsing.
- $user : mixed
-
The resource must be owned by this user.
Return values
array<string|int, mixed> —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(mixed $user[, mixed $limit = 5 ][, mixed $all = false ]) : array<string|int, mixed>
Parameters
- $user : mixed
-
The user whose tags should be included.
- $limit : mixed = 5
-
The maximum number of tags to include.
- $all : mixed = false
-
Return all tags, not just tags for the current types.
Return values
array<string|int, mixed> —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<string|int, mixed> $ids[, mixed $type = null ]) : array<string|int, mixed>
Parameters
- $ids : array<string|int, mixed>
-
An array of local object ids.
- $type : mixed = null
-
The type identifier of of the objects.
Return values
array<string|int, mixed> —An array of tag_ids => counts.
getTagIds()
Get tag ids for the specified tag names.
public
getTagIds(mixed $tags) : array<string|int, mixed>
Parameters
- $tags : mixed
-
Either a tag_name or array of tag_names.
Return values
array<string|int, mixed> —A tag_id => tag_name hash.
getTagInfo()
Returns cloud-like information, but only for a specified set of tags.
public
getTagInfo([mixed $tags = null ][, mixed $limit = 500 ][, mixed $type = null ][, mixed $user = null ]) : array<string|int, mixed>
Parameters
- $tags : mixed = null
-
An array of either tag names or ids.
- $limit : mixed = 500
-
Limit results to this many.
- $type : mixed = null
-
The type of resource.
- $user : mixed = null
-
Restrict results to those tagged by $user.
Return values
array<string|int, mixed> —An array of hashes, tag_id, tag_name, and count.
getTags()
Retrieves the tags on given object(s).
public
getTags(mixed $localId[, mixed $type = null ]) : array<string|int, mixed>
Parameters
- $localId : mixed
-
Either the identifier of the object or an array of identifiers.
- $type : mixed = null
-
The type of object $localId represents.
Return values
array<string|int, mixed> —A tag_id => tag_name hash, possibly wrapped in a localid hash.
listTags()
Returns tags belonging to the current user beginning with $token.
public
listTags(mixed $token) : array<string|int, mixed>
Parameters
- $token : mixed
-
The token to match the start of the tag with.
Return values
array<string|int, mixed> —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(mixed $localId, mixed $tags, mixed $owner[, mixed $content_type = null ]) : mixed
Parameters
- $localId : mixed
-
The identifier for the object.
- $tags : mixed
-
Either a tag_id, tag_name, or array of tag_ids.
- $owner : mixed
-
The tag owner - should normally be the resource owner.
- $content_type : mixed = null
-
The type of object that $localId represents.
search()
Searches for resources that are tagged with all of the requested tags.
public
search(mixed $tags[, mixed $filter = array() ]) : array<string|int, mixed>
Parameters
- $tags : mixed
-
Either a tag_id, tag_name or an array.
- $filter : mixed = array()
-
Array of filter parameters.
Return values
array<string|int, mixed> —A hash of results.
split()
Split a tag string into an array of tags.
public
split(string $tags) : array<string|int, mixed>
Overides Content_Tagger::split to only split on commas.
Parameters
- $tags : string
-
A string of tags to be split.
Return values
array<string|int, mixed> —The split tags.
tag()
Tags an object with any number of tags.
public
tag(mixed $localId, mixed $tags, mixed $owner[, mixed $content_type = null ]) : mixed
Parameters
- $localId : mixed
-
The identifier of the object.
- $tags : mixed
-
Either a single tag string or an array of tags.
- $owner : mixed
-
The tag owner (should normally be the owner of the resource).
- $content_type : mixed = null
-
The type of object we are tagging.
untag()
Removes a tag from an object.
public
untag(mixed $localId, mixed $tags[, mixed $content_type = null ]) : mixed
Parameters
- $localId : mixed
-
The object identifier.
- $tags : mixed
-
Either a tag_id, tag_name or an array of ids or names to remove.
- $content_type : mixed = null
-
The type of object that $localId represents.