Caching implementation for objects

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8745 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
dragan-dan 2011-08-10 17:47:59 +00:00
parent 1b47a294d3
commit 70a69ff4fe
18 changed files with 709 additions and 322 deletions

View file

@ -149,6 +149,22 @@
}
$oDB->commit();
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object');
if($oCacheHandler->isSupport())
{
foreach($document_srl_list as $document_srl)
{
$cache_key = 'object:'.$document_srl;
$oCacheHandler->delete($cache_key);
}
$cache_object = $oCacheHandler->get('module_list_documents');
foreach ($cache_object as $object){
$cache_key_object = $object;
$oCacheHandler->delete($cache_key_object);
}
$oCacheHandler->delete('module_list_documents');
}
return new Object();
}
@ -266,7 +282,30 @@
**/
function deleteModuleDocument($module_srl) {
$args->module_srl = $module_srl;
$oDocumentModel = &getModel('document');
$args->module_srl = $module_srl;
$document_list = $oDocumentModel->getDocumentList($args);
$documents = $document_list->data;
$output = executeQuery('document.deleteModuleDocument', $args);
foreach ($documents as $oDocument){
$document_srl_list[] = $oDocument->document_srl;
}
//remove from cache
$oCacheHandler = &CacheHandler::getInstance('object');
if($oCacheHandler->isSupport())
{
foreach($document_srl_list as $document_srl)
{
$cache_key = 'object:'.$document_srl;
$oCacheHandler->delete($cache_key);
}
$cache_object = $oCacheHandler->get('module_list_documents');
foreach ($cache_object as $object){
$cache_key_object = $object;
$oCacheHandler->delete($cache_key_object);
}
$oCacheHandler->delete('module_list_documents');
}
return $output;
}