Public Member Functions | Static Public Member Functions

Terms Class Reference

Inheritance diagram for Terms:
Collaboration diagram for Terms:

List of all members.

Public Member Functions

 has ($tags)
 field_load ($key)
 field_save ($key, $value)
 tree_sort ($sort_fn=null)

Static Public Member Functions

static parse ($terms, $term_class= '\Habari\Term', $vocabulary=null)

Detailed Description

Habari Terms Class Holds multiple Term object instances in an array-like structure, for the purpose of acting on them en-masse, or testing against them.

Definition at line 15 of file terms.php.


Member Function Documentation

Terms::field_load ( key  ) 

Loads form values from an object

Parameters:
string $key The name of a form component that will be loaded
Returns:
mixed The stored value returned

Implements FormStorage.

Definition at line 96 of file terms.php.

Terms::field_save ( key,
value 
)

Stores a form value into the object

Parameters:
string $key The name of a form component that will be stored
mixed $value The value of the form component to store

Implements FormStorage.

Definition at line 107 of file terms.php.

Terms::has ( tags  ) 

See if a term or set of terms is in this set of terms

Parameters:
mixed $tags. A string containing a string or a comma separated list of strings, or an array of strings, Terms, or a Term subclass
Returns:
boolean. Whether the tag(s) is in the current set of tags.

Definition at line 25 of file terms.php.

static Terms::parse ( terms,
term_class = '\Habari\Term',
vocabulary = null 
) [static]

Turns a comma-separated string or array of terms into an array of Term objects

Parameters:
mixed $terms A comma-separated string or array of string terms
string $term_class The class of the Term object type to create from each string
Vocabulary $vocabulary An instance of the Vocabulary that might hold the terms. Use existing term object data if found in the specified vocabulary.
Returns:
Terms An instance of Terms contianing the specified Term objects

Definition at line 50 of file terms.php.

Referenced by Post::__construct(), Post::__set(), has(), and Tags::save_associations().

Terms::tree_sort ( sort_fn = null  ) 

Sort the term objects by mptt_left ASC to put them in tree order

Returns:
Terms A sorted Terms instance

Definition at line 122 of file terms.php.


The documentation for this class was generated from the following file: