本文整理匯總了PHP中VTCacheUtils::lookupFieldInfoByColumn方法的典型用法代碼示例。如果您正苦於以下問題:PHP VTCacheUtils::lookupFieldInfoByColumn方法的具體用法?PHP VTCacheUtils::lookupFieldInfoByColumn怎麽用?PHP VTCacheUtils::lookupFieldInfoByColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類VTCacheUtils
的用法示例。
在下文中一共展示了VTCacheUtils::lookupFieldInfoByColumn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getColumnVisibilityPermission
/** Function to check permission to access the column for a given user
* @param $userid -- User Id :: Type integer
* @param $tablename -- tablename :: Type String
* @param $columnname -- columnname :: Type String
* @param $module -- Module Name :: Type varchar
*/
function getColumnVisibilityPermission($userid, $columnname, $module, $accessmode = 'readonly')
{
$adb = PearDatabase::getInstance();
$log = vglobal('log');
$log->debug("in function getcolumnvisibilitypermission {$columnname} -{$userid}");
$tabid = getTabid($module);
// Look at cache if information is available.
$cacheFieldInfo = VTCacheUtils::lookupFieldInfoByColumn($tabid, $columnname);
$fieldname = false;
if ($cacheFieldInfo === false) {
$res = $adb->pquery("select fieldname from vtiger_field where tabid=? and columnname=? and vtiger_field.presence in (0,2)", array($tabid, $columnname));
$fieldname = $adb->query_result($res, 0, 'fieldname');
} else {
$fieldname = $cacheFieldInfo['fieldname'];
}
return getFieldVisibilityPermission($module, $userid, $fieldname, $accessmode);
}