Class Tags

Description

Habari Tags Class

Located in /system/classes/tags.php (line 7)

ArrayObject
   |
   --Tags
Method Summary
static void delete (Tag $tag)
static array get ()
static A get_by_id (tag_id $tag)
static void get_by_slug ( $tag)
static void get_by_text ( $tag)
static QueryRecord get_one ( $tag)
static int max_count ()
static int post_count (mixed $tag)
static void rename (Array $master, mixed $tags)
Methods
static method delete (line 42)

Deletes a tag

  • access: public
static void delete (Tag $tag)
  • Tag $tag: tag The tag to be deleted
static method get (line 15)

Returns all tags THIS CLASS SHOULD CACHE QUERY RESULTS!

  • return: An array of Tag objects
  • access: public
static array get ()
static method get_by_id (line 174)

Returns a Tag object based on a supplied ID

  • return: Tag object
  • access: public
static A get_by_id (tag_id $tag)
  • tag_id $tag: The ID of the tag to retrieve
static method get_by_slug (line 163)
  • access: public
static void get_by_slug ( $tag)
  • $tag
static method get_by_text (line 158)
  • access: public
static void get_by_text ( $tag)
  • $tag
static method get_one (line 32)

Return a tag based on an id, tag text or slug

  • return: A tag QueryRecord
  • access: public
static QueryRecord get_one ( $tag)
  • $tag
static method max_count (line 137)

Returns the number of times the most used tag is used.

  • return: The number of times the most used tag is used.
  • access: public
static int max_count ()
static method post_count (line 147)

Returns the count of times a tag is used.

  • return: The number of times a tag is used.
  • access: public
static int post_count (mixed $tag)
  • mixed $tag: The tag to count usage.
static method rename (line 59)

TODO: be more careful INSERT INTO {tag2post} / SELECT $master_tag->ID,post_ID FROM {tag2post} WHERE tag_id = $tag->id" and then "DELETE FROM {tag2post} WHERE tag_id = $tag->id" Renames tags.

If the master tag exists, the tags will be merged with it. If not, it will be created first.

  • access: public
static void rename (Array $master, mixed $tags)
  • Array $master: tags The tag text, slugs or ids to be renamed
  • mixed $tags: master The Tag to which they should be renamed, or the slug, text or id of it

Inherited Methods

Inherited From ArrayObject (Internal Class)

constructor __construct ( $array )
append ( $value )
asort ( )
count ( )
exchangeArray ( $array )
getArrayCopy ( )
getFlags ( )
getIterator ( )
getIteratorClass ( )
ksort ( )
natcasesort ( )
natsort ( )
offsetExists ( $index )
offsetGet ( $index )
offsetSet ( $index, $newval )
offsetUnset ( $index )
setFlags ( $flags )
setIteratorClass ( $iteratorClass )
uasort ( $cmp_function )
uksort ( $cmp_function )
Class Constants

Inherited Constants

Inherited from ArrayObject (Internal Class)

ARRAY_AS_PROPS = 2
STD_PROP_LIST = 1

Documentation generated on Thu, 30 Oct 2008 20:31:28 +0100 by phpDocumentor 1.3.2