Cache grant information for modules and documents

https://www.xetown.com/qna/374223
http://sejin7940.co.kr/xe_tips/108198
This commit is contained in:
Kijin Sung 2016-09-16 16:44:29 +09:00
parent 4175535bc3
commit 9d594526b4
2 changed files with 43 additions and 9 deletions

View file

@ -1862,6 +1862,13 @@ class moduleModel extends module
*/
function getGrant($module_info, $member_info, $xml_info = '')
{
$cache_key = sprintf('site_and_module:module_grant:%d:%d', $module_info->module_srl, $member_info->member_srl);
$grant = Rhymix\Framework\Cache::get($cache_key);
if ($grant !== null)
{
return $grant;
}
$grant = new stdClass();
if(!$xml_info)
@ -2014,6 +2021,9 @@ class moduleModel extends module
}
}
}
// Set to cache and return
Rhymix\Framework\Cache::set($cache_key, $grant, 0, true);
return $grant;
}