Work on performance improvements with caching
This commit is contained in:
@@ -51,16 +51,15 @@ abstract class TSM_ORM extends ORM {
|
||||
|
||||
public function __get($column) {
|
||||
// Get a substited column name - need for DB2/DSMADMC schema differences
|
||||
if (isset($this->_tsm[$this->_db_group]['translate']) AND array_key_exists($column,$this->_tsm[$this->_db_group]['translate'])) {
|
||||
if (isset($this->_tsm[$this->_db_group]['translate']) AND array_key_exists($column,$this->_tsm[$this->_db_group]['translate']))
|
||||
return is_null($c=$this->_tsm[$this->_db_group]['translate'][$column]) ? NULL : parent::__get($c);
|
||||
}
|
||||
else
|
||||
return parent::__get($column);
|
||||
}
|
||||
|
||||
public function find() {
|
||||
// Check if we can preload our data and havent already done it
|
||||
if ($time = $this->isCacheable() AND is_null(Cache::instance()->get($cache_key = 'PRELOAD:'.$this->_table_name))) {
|
||||
if ($time = $this->isCacheable() AND is_null(Cache::instance(Kohana::$config->load('config')->cache)->get($cache_key = 'PRELOAD:'.$this->_table_name))) {
|
||||
|
||||
// Firstly set our cache, so that we dont get in a loop
|
||||
Cache::instance()->set($cache_key,TRUE,$time-1);
|
||||
|
Reference in New Issue
Block a user