added to cache getNewestCommentList

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9186 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
dragan-dan 2011-09-16 16:33:35 +00:00
parent 77a186161e
commit c929a055c5
2 changed files with 23 additions and 11 deletions

View file

@ -186,10 +186,18 @@
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
else $args->module_srl = $obj->module_srl;
$args->list_count = $obj->list_count;
$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object');
if($oCacheHandler->isSupport()){
$cache_key = 'object_newest_comment_list:'.$obj->module_srl;
$output = $oCacheHandler->get($cache_key);
}
if(!$output){
$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
}
if(!$output->toBool()) return $output;
$comment_list = $output->data;
if($comment_list) {
if(!is_array($comment_list)) $comment_list = array($comment_list);