public function get_tree($orderby = 'mptt_left ASC')
{
$query = Query::create('{terms}')->select('{terms}.*');
$query->where()->in('vocabulary_id', $this->id);
// If the vocabulary is unique, save the extra mess of queries and fetch the object data, too
if (in_array('unique', $this->features)) {
$query->join('LEFT JOIN {object_terms} on {object_terms}.term_id = {terms}.id', array(), 'object_terms');
$query->join('LEFT JOIN {object_types} on {object_types}.id = {object_terms}.object_type_id', array(), 'object_types');
$query->select('{object_terms}.object_id');
$query->select('{object_types}.name AS type');
}
$query->orderby($orderby);
return new Terms($query->results('Term'));
}