Class Ansel_Tags

Description

Static helper class for writing/reading tag values

Located in /lib/Tags.php (line 26)


	
			
Method Summary
 void clearCache ()
 void clearSearch ()
 mixed getRelatedTags ( $ids, array $tags)
 void getSearch ([ $tags = null], [ $owner = null])
 mixed getTagIds (array $tags)
 string getTagLinks (array $tags, [string $action = 'add'], [string $owner = null])
 void getTagNames ( $ids)
 mixed listTagInfo ([array $tags = null], [integer $limit = 500])
 void listTags ([ $search = ''], [ $limit = 100])
 mixed readTags (int $resource_id, [string $resource_type = 'image'])
 mixed searchTags ([array $names = array()], [int $max = 10], [int $from = 0], [string $resource_type = 'all'], [string $user = null])
 mixed searchTagsById (array $ids, [int $max = 0], [int $from = 0], [string $resource_type = 'all'], [string $user = null])
 mixed writeTags (int $resource_id, array $tags, [string $resource_type = 'image'])
Methods
clearCache (line 457)
void clearCache ()
clearSearch (line 452)

Clear the session cache

void clearSearch ()
getRelatedTags (line 302)

Retrieve a set of tags with relationships to the specified set of tags.

  • return: A hash of tag_id -> tag_name | PEAR_Error
mixed getRelatedTags ( $ids, array $tags)
  • array $tags: An array of tag_ids
  • $ids
getSearch (line 444)

Retrieve an Ansel_Tags_Search object

void getSearch ([ $tags = null], [ $owner = null])
  • $tags
  • $owner
getTagIds (line 386)

Get a list of tag_ids from a list of tag_names

  • return: An array of tag_names => tag_ids | PEAR_Error
mixed getTagIds (array $tags)
  • array $tags: An array of tag_names
getTagLinks (line 360)

Get the URL for a tag link

  • return: The URL for this tag and action
string getTagLinks (array $tags, [string $action = 'add'], [string $owner = null])
  • array $tags: The tag ids to link to
  • string $action: The action we want to perform with this tag.
  • string $owner: The owner we want to filter the results by
getTagNames (line 407)
void getTagNames ( $ids)
  • $ids
listTagInfo (line 129)

Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.

  • return: An array containing tag_name, and total | PEAR_Error
mixed listTagInfo ([array $tags = null], [integer $limit = 500])
  • array $tags: An optional array of tag_ids. If omitted, all tags will be included.
  • integer $limit: Limit the number of tags returned to this value.
listTags (line 429)

List tag names that start with a given string. Used for autocompletion.

void listTags ([ $search = ''], [ $limit = 100])
  • $search
  • $limit
readTags (line 96)

Retrieve the tags for a specified resource.

  • return: An array of tags | PEAR_Error
mixed readTags (int $resource_id, [string $resource_type = 'image'])
  • int $resource_id: The resource to get tags for.
  • string $resource_type: The type of resource (gallery or image)
searchTags (line 285)

Search for resources matching a specified set of tags and optionally limit the result set to resources owned by a specific user.

  • return: An array of image_ids and gallery_ids | PEAR_Error
mixed searchTags ([array $names = array()], [int $max = 10], [int $from = 0], [string $resource_type = 'all'], [string $user = null])
  • array $names: An array of tag strings to search for.
  • int $max: The maximum number of resources to return.
  • int $from: The resource to start at.
  • string $resource_type: Either 'images', 'galleries', or 'all'.
  • string $user: Limit the result set to resources owned by specified user.
searchTagsById (line 177)

Search for resources matching the specified criteria

  • return: An array of image_ids and galery_ids objects | PEAR_Error
mixed searchTagsById (array $ids, [int $max = 0], [int $from = 0], [string $resource_type = 'all'], [string $user = null])
  • array $ids: An array of tag_ids to search for.
  • int $max: The maximum number of resources to return.
  • int $from: The number to start from
  • string $resource_type: Either 'images', 'galleries', or 'all'.
  • string $user: Limit the result set to resources owned by this user.
writeTags (line 37)

Write out the tags for a specific resource.

  • return: True | PEAR_Error
mixed writeTags (int $resource_id, array $tags, [string $resource_type = 'image'])
  • int $resource_id: The resource we are tagging.
  • array $tags: An array of tags.
  • string $resource_type: The type of resource (image or gallery)

Documentation generated on Sun, 30 Jan 2011 05:08:49 +0000 by phpDocumentor 1.4.3