public function last_row($type = 'object') { $result = $this->result($type); return count($result) === 0 ? NULL : $result[count($result) - 1]; }