PHP Класс Habari\Terms

Наследование: extends ArrayObject, implements habari\FormStorage
Показать файл Открыть проект

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

Метод Описание
field_load ( string $key ) : mixed Loads form values from an object
field_save ( string $key, mixed $value ) Stores a form value into the object
has ( $tags ) : boolean. See if a term or set of terms is in this set of terms
parse ( mixed $terms, string $term_class = '\Habari\Term', Vocabulary $vocabulary = null ) : Terms Turns a comma-separated string or array of terms into an array of Term objects
tree_sort ( $sort_fn = null ) : Terms Sort the term objects by mptt_left ASC to put them in tree order

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

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

Loads form values from an object
public field_load ( string $key ) : mixed
$key string The name of a form component that will be loaded
Результат mixed The stored value returned

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

Stores a form value into the object
public field_save ( string $key, mixed $value )
$key string The name of a form component that will be stored
$value mixed The value of the form component to store

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

See if a term or set of terms is in this set of terms
public has ( $tags ) : boolean.
Результат boolean.

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

Turns a comma-separated string or array of terms into an array of Term objects
public static parse ( mixed $terms, string $term_class = '\Habari\Term', Vocabulary $vocabulary = null ) : Terms
$terms mixed A comma-separated string or array of string terms
$term_class string 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.
Результат Terms An instance of Terms contianing the specified Term objects

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

Sort the term objects by mptt_left ASC to put them in tree order
public tree_sort ( $sort_fn = null ) : Terms
Результат Terms A sorted Terms instance