PHP Class Habari\Term

Inheritance: extends QueryRecord
Afficher le fichier Open project: habari/system

Méthodes publiques

Свойство Type Description
$unsetfields

Protected Properties

Свойство Type Description
$inforecords

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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.

Method Details

__call() public méthode

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
Résultat mixed The value returned from any plugin filters, null if no value is returned

__construct() public méthode

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

__get() public méthode

function __get Overrides QueryRecord __get to implement custom object properties
public __get ( $name ) : mixed
$name string Name of property to return
Résultat mixed The requested field value

__tostring() public méthode

Allow output when the term is cast to a string
public __tostring ( ) : string
Résultat string The terms display text

ancestors() public méthode

Find this Term's ancestors.
public ancestors ( ) : Array
Résultat Array Direct ancestors from the root to this Term in descendant order.

associate() public méthode

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() public méthode

Find this Term's children.
public children ( ) : Array
Résultat Array of all direct children (compare to descendants()).

count() public méthode

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
Résultat integer The number of times the tag has been used

default_fields() public static méthode

Return the defined database columns for a Term.
public static default_fields ( ) : array
Résultat array Array of columns in the Term table

delete() public méthode

Delete an existing term
public delete ( )

descendants() public méthode

Find this Term's descendants.
public descendants ( ) : Array
Résultat Array of all descendants in MPTT left-to-right order.

dissociate() public méthode

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() public static méthode

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.
Résultat Term The Term object requested

get_info() protected méthode

Gets the info object for this term, which contains data from the terminfo table related to this term.
protected get_info ( ) : TermInfo
Résultat TermInfo object

insert() public méthode

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

is_ancestor_of() public méthode

Test a Term's ancestry
public is_ancestor_of ( Term $term ) : boolean
$term Term
Résultat boolean true if $term is a descendant of $this

is_descendant_of() public méthode

Test a Term's lineage.
public is_descendant_of ( Term $term ) : boolean
$term Term
Résultat boolean true if $term is an ancestor of $this

is_valid() protected méthode

Make sure we have a valid term before inserting it in the database or updating it
protected is_valid ( ) : boolean
Résultat boolean True if a valid term, false if not

not_ancestors() public méthode

Find all Terms in this Term's Vocabulary that are not its ancestors, or it.
public not_ancestors ( ) : Array
Résultat Array of Terms in MPTT left-to-right order.

not_descendants() public méthode

Find all Terms in this Term's Vocabulary that are not its descendants, or it.
public not_descendants ( ) : Array
Résultat Array of Terms in MPTT left-to-right order.

object_count() public méthode

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.
Résultat Array of object ids associated with this term for the given type.

object_types() public méthode

Find the types of objects associated with this Term.
public object_types ( ) : Array
Résultat Array of objects, with each object containing an object id and an object type name

objects() public méthode

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.
Résultat Array of object ids associated with this term for the given type.

parent() public méthode

The Term that is this Term's parent in hierarchy.
public parent ( ) : Term
Résultat Term This Term's parent

setslug() protected méthode

Generate a new slug for the post.
protected setslug ( ) : string
Résultat string The slug

siblings() public méthode

Find this Term's siblings.
public siblings ( ) : Array
Résultat Array of all siblings including self.

update() public méthode

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

Property Details

$inforecords protected_oe property

protected $inforecords

$unsetfields public_oe property

public $unsetfields