public get ( $key ) |
public function get($key)
{
if (is_array($key)) {
$result = array();
foreach ($key as $column) {
$result[$column] = isset($this->_data[$column]) ? $this->_data[$column] : null;
}
return $result;
} else {
return isset($this->_data[$key]) ? $this->_data[$key] : null;
}
}
/** * Add the optional last_topic column (only accessible if record_last_topic is true) * * @param string $column * @return mixed|ORM */ public function get($column) { if ($column == 'last_topic' && parent::get('location')->record_last_topic == 1) { return ORM::factory('Quill_Topic')->where('category_id', '=', $this->id)->order_by('updated_at', 'DESC')->limit(1)->find(); } return parent::get($column); }