List of all members.
Detailed Description
Definition at line 17 of file term.php.
Constructor & Destructor Documentation
| Term::__construct |
( |
$ |
paramarray = array() |
) |
|
Term constructor Creates a Term instance
- Parameters:
-
| array | $paramarray an associative array of initial term values |
Reimplemented from QueryRecord.
Reimplemented in Tag.
Definition at line 43 of file term.php.
Member Function Documentation
| Term::__call |
( |
$ |
name, |
|
|
$ |
args | |
|
) |
| | |
Handle calls to this Term object that are implemented by plugins
- Parameters:
-
| string | $name The name of the function called |
| array | $args Arguments passed to the function call |
- Returns:
- mixed The value returned from any plugin filters, null if no value is returned
Reimplemented in Tag.
Definition at line 505 of file term.php.
function __get Overrides QueryRecord __get to implement custom object properties
- Parameters:
-
| $name | string Name of property to return |
- Returns:
- mixed The requested field value
Reimplemented from QueryRecord.
Definition at line 442 of file term.php.
Allow output when the term is cast to a string
- Returns:
- string The terms display text
Definition at line 431 of file term.php.
Find this Term's ancestors.
- Returns:
- Array Direct ancestors from the root to this Term in descendant order.
Definition at line 215 of file term.php.
| Term::associate |
( |
$ |
type, |
|
|
$ |
id | |
|
) |
| | |
Associate this term to an object of a certain type via its id.
- Parameters:
-
| $type | string. The name of the object type we want to set an association for |
| $id | integer. The object's id |
Definition at line 390 of file term.php.
Find this Term's children.
- Returns:
- Array of all direct children (compare to descendants()).
If we INNER JOIN the terms table with itself on ALL the descendants of our term, then descendants one level down are listed once, two levels down are listed twice, etc. If we return only those terms which appear once, we get immediate children. ORDER BY NULL to avoid the MySQL filesort.
Definition at line 315 of file term.php.
| Term::count |
( |
$ |
object_type = 'post' |
) |
|
Get a count of how many times the tag has been used in a post
- Parameters:
-
| string | $object_type The type of object to count |
- Returns:
- integer The number of times the tag has been used
Definition at line 494 of file term.php.
Referenced by __get(), and Tag::rewrite_tag_exists().
| static Term::default_fields |
( |
|
) |
[static] |
Return the defined database columns for a Term.
- Returns:
- array Array of columns in the Term table
Definition at line 25 of file term.php.
Find this Term's descendants.
- Returns:
- Array of all descendants in MPTT left-to-right order.
Definition at line 237 of file term.php.
| Term::dissociate |
( |
$ |
type = null, |
|
|
$ |
id = null | |
|
) |
| | |
Disassociate this term from an object of a certain type via its id.
- Parameters:
-
| $type | string. The name of the object type we want to unset an association for |
| $id | integer. The object's id |
Definition at line 412 of file term.php.
| static Term::get |
( |
$ |
term, |
|
|
$ |
term_class = 'Term' | |
|
) |
| | [static] |
Gets the term object by criteria.
- Parameters:
-
| mixed | $term A Term object, a string (for a term slug or display), or an integer (for a Term ID). |
| string | $term_class The class of the returned term object. |
- Returns:
- Term The Term object requested
- Todo:
- improve selective fetching by term slug vs term_display
Definition at line 518 of file term.php.
| Term::get_info |
( |
|
) |
[protected] |
Gets the info object for this term, which contains data from the terminfo table related to this term.
- Returns:
- TermInfo object
Definition at line 476 of file term.php.
Referenced by __get().
| Term::is_ancestor_of |
( |
Term $ |
term |
) |
|
Test a Term's ancestry
- Returns:
- boolean true if $term is a descendant of $this
Definition at line 274 of file term.php.
| Term::is_descendant_of |
( |
Term $ |
term |
) |
|
Test a Term's lineage.
- Returns:
- boolean true if $term is an ancestor of $this
Definition at line 259 of file term.php.
Find all Terms in this Term's Vocabulary that are not its ancestors, or it.
- Returns:
- Array of Terms in MPTT left-to-right order.
Definition at line 226 of file term.php.
| Term::not_descendants |
( |
|
) |
|
Find all Terms in this Term's Vocabulary that are not its descendants, or it.
- Returns:
- Array of Terms in MPTT left-to-right order.
Definition at line 248 of file term.php.
| Term::object_count |
( |
$ |
type |
) |
|
Find the count of objects of a given type associated with this Term.
- Parameters:
-
| $type | string. The name of the object type for which the associations are wanted. |
- Returns:
- Array of object ids associated with this term for the given type.
Definition at line 377 of file term.php.
Referenced by count().
Find the types of objects associated with this Term.
- Returns:
- Array of objects, keyed by object id, values are type names
Definition at line 365 of file term.php.
Find objects of a given type associated with this Term.
- Parameters:
-
| $type | string. The name of the object type for which the associations are wanted. |
- Returns:
- Array of object ids associated with this term for the given type.
Definition at line 353 of file term.php.
| Term::setslug |
( |
|
) |
[protected] |
Generate a new slug for the post.
- Returns:
- string The slug
Definition at line 76 of file term.php.
Referenced by insert(), and update().
Find this Term's siblings.
- Returns:
- Array of all siblings including self.
Definition at line 300 of file term.php.
function update Updates an existing term in the terms table
Reimplemented from QueryRecord.
Definition at line 157 of file term.php.
The documentation for this class was generated from the following file: