/**
* @param null|integer $id
* @return Model
*/
public function get_datatable($options = array())
{
$limit = $this->_limit;
$offset = $this->_offset;
$this->_limit = null;
$this->_offset = null;
$this->cnt_query = true;
$cnt = parent::find_array();
if (isset($cnt[0]['_dt_record_cnt'])) {
$cnt = $cnt[0]['_dt_record_cnt'];
} else {
// @todo throw error
$cnt = 0;
}
$this->_limit = $limit;
$this->_offset = $offset;
$this->cnt_query = false;
$results = $this->_create_json(parent::find_array(), $cnt, $options);
return $results;
}