Kronolith interface to the Horde_Content tagger
Copyright 2009-2012 Horde LLC (http://www.horde.org/)
Methods summary
public
Kronolith_Tagger
|
|
public
|
#
tag( string $localId, mixed $tags, string $owner, string $content_type = 'event' )
Tags a kronolith object with any number of tags.
Tags a kronolith object with any number of tags.
Parameters
- $localId
- The identifier of the kronolith object.
- $tags
- <p>Either a single tag string or an array of
tags.</p>
- $owner
- <p>The tag owner (should normally be the owner
of the resource).</p>
- $content_type
- <p>The type of object we are tagging
(event/calendar).</p>
|
public
array
|
#
getTags( mixed $localId, string $type = 'event' )
Retrieves the tags on given object(s).
Retrieves the tags on given object(s).
Parameters
- $localId
- <p>Either the identifier of the kronolith object or
an array of identifiers.</p>
- $type
- The type of object $localId represents.
Returns
array A tag_id => tag_name hash, possibly wrapped in a localid hash.
|
public
|
#
untag( string $localId, mixed $tags, string $content_type = 'event' )
Removes a tag from a kronolith object.
Removes a tag from a kronolith object.
Removes all tags - regardless of the user that added the tag.
Parameters
- $localId
- The kronolith object identifier.
- $tags
- <p>Either a tag_id, tag_name or an array of
ids or names to remove.</p>
- $content_type
- The type of object that $localId represents.
|
public
|
#
replaceTags( string $localId, mixed $tags, string $owner, mixed $content_type = 'event' )
Tags the given resource with only the tags provided, removing any
tags that are already present but not in the list.
Tags the given resource with only the tags provided, removing any
tags that are already present but not in the list.
Parameters
- $localId
- The identifier for the kronolith object.
- $tags
- Either a tag_id, tag_name, or array of tag_ids.
- $owner
- <p>The tag owner - should normally be the resource
owner.</p>
- $content_type
- type of object that $localId represents.
|
public
A
|
#
search( array $tags, array $filter = array() )
Searches for resources that are tagged with all of the requested tags.
Searches for resources that are tagged with all of the requested tags.
Parameters
- $tags
- Either a tag_id, tag_name or an array.
- $filter
- <p>Array of filter parameters.
- type (string) - only return either events or
calendars, not both.
- user (array) - only include objects owned by
these users.
- calendar (array) - restrict to events contained
in these calendars.</p>
Returns
A hash of 'calendars' and 'events' that each contain an array
of calendar_ids and event_uids respectively.
|
public
A
|
#
listTags( string $token )
Returns tags belonging to the current user beginning with $token.
Returns tags belonging to the current user beginning with $token.
Used for autocomplete code.
Parameters
- $token
- The token to match the start of the tag with.
Returns
A tag_id => tag_name hash
|
public
An
|
#
getCloud( string $user, integer $limit = 5 )
Returns the data needed to build a tag cloud based on the passed in
user's tag data set.
Returns the data needed to build a tag cloud based on the passed in
user's tag data set.
Parameters
- $user
- The user whose tags should be included.
- $limit
- The maximum number of tags to include.
Returns
An array of hashes, each containing tag_id, tag_name, and count.
|
public
array
|
#
getTagInfo( array $tags = null, integer $limit = 500, string $type = null, string $user = null )
Returns cloud-like information, but only for a specified set of tags.
Returns cloud-like information, but only for a specified set of tags.
Parameters
- $tags
- An array of either tag names or ids.
- $limit
- Limit results to this many.
- $type
- The type of resource (event, calendar, null).
- $user
- Restrict results to those tagged by $user.
Returns
array An array of hashes, tag_id, tag_name, and count.
Throws
Ansel_Exception
|