本文整理匯總了PHP中Users_Privileges_Model::getInstanceFromUserObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP Users_Privileges_Model::getInstanceFromUserObject方法的具體用法?PHP Users_Privileges_Model::getInstanceFromUserObject怎麽用?PHP Users_Privileges_Model::getInstanceFromUserObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Users_Privileges_Model
的用法示例。
在下文中一共展示了Users_Privileges_Model::getInstanceFromUserObject方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: convertTimeIntoUsersDisplayFormat
/**
* Function to get the time value in user preferred hour format
* @param <Time> $time
* @param <Vtiger_Users_Model> $userObject
* @return <String> time with hour format
*/
public static function convertTimeIntoUsersDisplayFormat($time, $userObject = null) {
require_once 'includes/runtime/LanguageHandler.php';
require_once 'includes/runtime/Globals.php';
if ($userObject) {
$userModel = Users_Privileges_Model::getInstanceFromUserObject($userObject);
} else {
$userModel = Users_Privileges_Model::getCurrentUserModel();
}
if($userModel->get('hour_format') == '12') {
$time = Vtiger_Time_UIType::getTimeValueInAMorPM($time);
}
return $time;
}