本文整理匯總了PHP中VTCacheUtils::updateTabidInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP VTCacheUtils::updateTabidInfo方法的具體用法?PHP VTCacheUtils::updateTabidInfo怎麽用?PHP VTCacheUtils::updateTabidInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類VTCacheUtils
的用法示例。
在下文中一共展示了VTCacheUtils::updateTabidInfo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getTabModuleName
/** Function to get the tab module name for a given id
* @param $tabid -- tab id:: Type integer
* @returns $string -- string:: Type string
*/
function getTabModuleName($tabid)
{
global $log, $adb;
$log->debug("Entering getTabModuleName(" . $tabid . ") method ...");
// Lookup information in cache first
$tabname = VTCacheUtils::lookupModulename($tabid);
if ($tabname === false) {
if (file_exists('tabdata.php') && filesize('tabdata.php') != 0) {
include 'tabdata.php';
$tabname = array_search($tabid, $tab_info_array);
if ($tabname == false) {
$sql = "select name from vtiger_tab where tabid=?";
$result = $adb->pquery($sql, array($tabid));
$tabname = $adb->query_result($result, 0, "name");
}
// Update information to cache for re-use
VTCacheUtils::updateTabidInfo($tabid, $tabname);
} else {
$log->info("tab id is " . $tabid);
$sql = "select name from vtiger_tab where tabid=?";
$result = $adb->pquery($sql, array($tabid));
$tabname = $adb->query_result($result, 0, "name");
// Update information to cache for re-use
VTCacheUtils::updateTabidInfo($tabid, $tabname);
}
}
$log->debug("Exiting getTabModuleName method ...");
return $tabname;
}
示例2: getTabid
/**
* Function to get the tabid
* Takes the input as $module - module name
* returns the tabid, integer type
*/
function getTabid($module)
{
global $log;
$log->debug("Entering getTabid(" . $module . ") method ...");
// Lookup information in cache first
$tabid = VTCacheUtils::lookupTabid($module);
if ($tabid === false) {
if (file_exists('tabdata.php') && filesize('tabdata.php') != 0) {
include 'tabdata.php';
$tabid = $tab_info_array[$module];
// Update information to cache for re-use
VTCacheUtils::updateTabidInfo($tabid, $module);
} else {
$log->info("module is " . $module);
global $adb;
$sql = "select tabid from vtiger_tab where name=?";
$result = $adb->pquery($sql, array($module));
$tabid = $adb->query_result($result, 0, "tabid");
// Update information to cache for re-use
VTCacheUtils::updateTabidInfo($tabid, $module);
}
}
$log->debug("Exiting getTabid method ...");
return $tabid;
}