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;
}