cache improvements 2

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9142 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
dragan-dan 2011-09-13 16:27:17 +00:00
parent aa1f0ceddc
commit 054a2e7e81
6 changed files with 188 additions and 38 deletions

View file

@ -27,10 +27,19 @@
function _loadFromDB($load_extra_vars = true) {
if(!$this->document_srl) return;
$args->document_srl = $this->document_srl;
$output = executeQuery('document.getDocument', $args, $this->columnList);
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object');
if($oCacheHandler->isSupport()){
$cache_key = 'object_document_item:'.$this->document_srl;
$output = $oCacheHandler->get($cache_key);
}
if(!$output) {
$args->document_srl = $this->document_srl;
$output = executeQuery('document.getDocument', $args, $this->columnList);
//insert in cache
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
}
$this->setAttribute($output->data,$load_extra_vars);
}