Some caching improvements

This commit is contained in:
Deon George
2011-05-31 10:42:47 +10:00
parent d29b29fa07
commit 6aabf025ca
4 changed files with 8 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ class Controller_NODE extends Controller_TemplateDefault {
$no = ORM::factory('node');
$output = '';
$output .= sprintf(_('This server has <b>%s</b> defined nodes.'),$no->cached(0)->count_all());
$output .= sprintf(_('This server has <b>%s</b> defined nodes.'),$no->count_all());
$output .= '<br/>';
$output .= '<br/>';

View File

@@ -25,12 +25,12 @@ class ORMTSM extends ORM {
protected $_formated = FALSE;
protected $_formats = array();
public function __construct($id = NULL) {
parent::__construct($id);
protected function _load_result($multiple = FALSE) {
// We'll cache our query results
if ($c = $this->_db->caching($this->_table_name))
$this->cached($c);
$this->_db_builder->cached($c);
return parent::_load_result($multiple);
}
/**