Habari\Term::__get PHP Метод

__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
    public function __get($name)
    {
        switch ($name) {
            case 'vocabulary':
                $out = Vocabulary::get_by_id($this->vocabulary_id);
                break;
            case 'tag_text_searchable':
                // if it's got spaces, then quote it.
                if (strpos($this->term_display, ' ') !== false || strpos($this->term_display, ',') !== false) {
                    $out = '\'' . str_replace("'", "\\'", $this->term_display) . '\'';
                } else {
                    $out = $this->term_display;
                }
                break;
            case 'count':
                $out = (int) $this->count();
                break;
            case 'id':
                return (int) parent::__get($name);
            case 'info':
                return $this->get_info();
            default:
                $out = parent::__get($name);
                break;
        }
        return $out;
    }