PHP Класс Habari\Term

Наследование: extends QueryRecord
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$unsetfields

Защищенные свойства (Protected)

Свойство Тип Описание
$inforecords

Открытые методы

Метод Описание
__call ( string $name, array $args ) : mixed Handle calls to this Term object that are implemented by plugins
__construct ( array $paramarray = [] ) Term constructor Creates a Term instance
__get ( $name ) : mixed function __get Overrides QueryRecord __get to implement custom object properties
__tostring ( ) : string Allow output when the term is cast to a string
ancestors ( ) : Array Find this Term's ancestors.
associate ( $type, $id ) Associate this term to an object of a certain type via its id.
children ( ) : Array Find this Term's children.
count ( string $object_type = 'post' ) : integer Get a count of how many times the tag has been used in a post
default_fields ( ) : array Return the defined database columns for a Term.
delete ( ) Delete an existing term
descendants ( ) : Array Find this Term's descendants.
dissociate ( $type = null, $id = null ) Disassociate this term from an object of a certain type via its id.
get ( mixed $term, string $term_class = 'Term' ) : Term Gets the term object by criteria.
insert ( ) function insert Saves a new term to the terms table
is_ancestor_of ( Term $term ) : boolean Test a Term's ancestry
is_descendant_of ( Term $term ) : boolean Test a Term's lineage.
not_ancestors ( ) : Array Find all Terms in this Term's Vocabulary that are not its ancestors, or it.
not_descendants ( ) : Array Find all Terms in this Term's Vocabulary that are not its descendants, or it.
object_count ( $type ) : Array Find the count of objects of a given type associated with this Term.
object_types ( ) : Array Find the types of objects associated with this Term.
objects ( $type ) : Array Find objects of a given type associated with this Term.
parent ( ) : Term The Term that is this Term's parent in hierarchy.
siblings ( ) : Array Find this Term's siblings.
update ( ) function update Updates an existing term in the terms table

Защищенные методы

Метод Описание
get_info ( ) : TermInfo Gets the info object for this term, which contains data from the terminfo table related to this term.
is_valid ( ) : boolean Make sure we have a valid term before inserting it in the database or updating it
setslug ( ) : string Generate a new slug for the post.

Описание методов

__call() публичный Метод

Handle calls to this Term object that are implemented by plugins
public __call ( string $name, array $args ) : mixed
$name string The name of the function called
$args array Arguments passed to the function call
Результат mixed The value returned from any plugin filters, null if no value is returned

__construct() публичный Метод

Term constructor Creates a Term instance
public __construct ( array $paramarray = [] )
$paramarray array an associative array of initial term values

__get() публичный Метод

function __get Overrides QueryRecord __get to implement custom object properties
public __get ( $name ) : mixed
$name string Name of property to return
Результат mixed The requested field value

__tostring() публичный Метод

Allow output when the term is cast to a string
public __tostring ( ) : string
Результат string The terms display text

ancestors() публичный Метод

Find this Term's ancestors.
public ancestors ( ) : Array
Результат Array Direct ancestors from the root to this Term in descendant order.

associate() публичный Метод

Associate this term to an object of a certain type via its id.
public associate ( $type, $id )
$type string. The name of the object type we want to set an association for
$id integer. The object's id

children() публичный Метод

Find this Term's children.
public children ( ) : Array
Результат Array of all direct children (compare to descendants()).

count() публичный Метод

Get a count of how many times the tag has been used in a post
public count ( string $object_type = 'post' ) : integer
$object_type string The type of object to count
Результат integer The number of times the tag has been used

default_fields() публичный статический Метод

Return the defined database columns for a Term.
public static default_fields ( ) : array
Результат array Array of columns in the Term table

delete() публичный Метод

Delete an existing term
public delete ( )

descendants() публичный Метод

Find this Term's descendants.
public descendants ( ) : Array
Результат Array of all descendants in MPTT left-to-right order.

dissociate() публичный Метод

Disassociate this term from an object of a certain type via its id.
public dissociate ( $type = null, $id = null )
$type string. The name of the object type we want to unset an association for
$id integer. The object's id

get() публичный статический Метод

Gets the term object by criteria.
public static get ( mixed $term, string $term_class = 'Term' ) : Term
$term mixed A Term object, a string (for a term slug or display), or an integer (for a Term ID).
$term_class string The class of the returned term object.
Результат Term The Term object requested

get_info() защищенный Метод

Gets the info object for this term, which contains data from the terminfo table related to this term.
protected get_info ( ) : TermInfo
Результат TermInfo object

insert() публичный Метод

function insert Saves a new term to the terms table
public insert ( )

is_ancestor_of() публичный Метод

Test a Term's ancestry
public is_ancestor_of ( Term $term ) : boolean
$term Term
Результат boolean true if $term is a descendant of $this

is_descendant_of() публичный Метод

Test a Term's lineage.
public is_descendant_of ( Term $term ) : boolean
$term Term
Результат boolean true if $term is an ancestor of $this

is_valid() защищенный Метод

Make sure we have a valid term before inserting it in the database or updating it
protected is_valid ( ) : boolean
Результат boolean True if a valid term, false if not

not_ancestors() публичный Метод

Find all Terms in this Term's Vocabulary that are not its ancestors, or it.
public not_ancestors ( ) : Array
Результат Array of Terms in MPTT left-to-right order.

not_descendants() публичный Метод

Find all Terms in this Term's Vocabulary that are not its descendants, or it.
public not_descendants ( ) : Array
Результат Array of Terms in MPTT left-to-right order.

object_count() публичный Метод

Find the count of objects of a given type associated with this Term.
public object_count ( $type ) : Array
$type string. The name of the object type for which the associations are wanted.
Результат Array of object ids associated with this term for the given type.

object_types() публичный Метод

Find the types of objects associated with this Term.
public object_types ( ) : Array
Результат Array of objects, with each object containing an object id and an object type name

objects() публичный Метод

Find objects of a given type associated with this Term.
public objects ( $type ) : Array
$type string. The name of the object type for which the associations are wanted.
Результат Array of object ids associated with this term for the given type.

parent() публичный Метод

The Term that is this Term's parent in hierarchy.
public parent ( ) : Term
Результат Term This Term's parent

setslug() защищенный Метод

Generate a new slug for the post.
protected setslug ( ) : string
Результат string The slug

siblings() публичный Метод

Find this Term's siblings.
public siblings ( ) : Array
Результат Array of all siblings including self.

update() публичный Метод

function update Updates an existing term in the terms table
public update ( )

Описание свойств

$inforecords защищенное свойство

protected $inforecords

$unsetfields публичное свойство

public $unsetfields