public function object_count($type) { $type_id = Vocabulary::object_type_id($type); $result = DB::get_value("SELECT count(object_id) FROM {object_terms} WHERE term_id = ? AND object_type_id = ?", array($this->id, $type_id)); return $result; }