$_type_ids
$_type_ids : array
Cache of type name => ids from Content
Null driver for the Horde_Content tagger.
tag(string $localId, mixed $tags, string $owner, string $content_type = null)
Tags an object with any number of tags.
string | $localId | The identifier of the object. |
mixed | $tags | Either a single tag string or an array of tags. |
string | $owner | The tag owner (should normally be the owner of the resource). |
string | $content_type | The type of object we are tagging. |
getTags(mixed $localId, string $type = null) : array
Retrieves the tags on given object(s).
mixed | $localId | Either the identifier of the object or an array of identifiers. |
string | $type | The type of object $localId represents. |
A tag_id => tag_name hash, possibly wrapped in a localid hash.
untag(string $localId, mixed $tags, string $content_type = null)
Removes a tag from an object.
Removes all tags - regardless of the user that added the tag.
string | $localId | The object identifier. |
mixed | $tags | Either a tag_id, tag_name or an array of ids or names to remove. |
string | $content_type | The type of object that $localId represents. |
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.
string | $localId | The identifier for the object. |
mixed | $tags | Either a tag_id, tag_name, or array of tag_ids. |
string | $owner | The tag owner - should normally be the resource owner. |
string | $content_type | The type of object that $localId represents. |
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.
string | $user | The user whose tags should be included. |
integer | $limit | The maximum number of tags to include. |
boolean | $all | Return all tags, not just tags for the current types. |
An array of hashes, each containing tag_id, tag_name, and count.
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.
array | $ids | An array of local object ids. |
integer | $type | The type identifier of of the objects. |
An array of tag_ids => counts.
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.
array | $tags | An array of tags to check. This would represent the current "directory" of tags while browsing. |
string | $user | The resource must be owned by this user. |
A tag_id => tag_name hash.
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.
array | $tags | An array of either tag names or ids. |
integer | $limit | Limit results to this many. |
string | $type | The type of resource. |
string | $user | Restrict results to those tagged by $user. |
An array of hashes, tag_id, tag_name, and count.