PHP 클래스 Habari\Terms

상속: extends ArrayObject, implements habari\FormStorage
파일 보기 프로젝트 열기: habari/system

공개 메소드들

메소드 설명
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