本文整理汇总了PHP中OA_Dal_Delivery_getAccountTZs函数的典型用法代码示例。如果您正苦于以下问题:PHP OA_Dal_Delivery_getAccountTZs函数的具体用法?PHP OA_Dal_Delivery_getAccountTZs怎么用?PHP OA_Dal_Delivery_getAccountTZs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OA_Dal_Delivery_getAccountTZs函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_DeliveryDB_getAdminTZ
function test_DeliveryDB_getAdminTZ()
{
// Create the admin account
$doAccounts = OA_Dal::factoryDO('accounts');
$doAccounts->account_name = 'System Administrator';
$doAccounts->account_type = OA_ACCOUNT_ADMIN;
$adminAccountId = DataGenerator::generateOne($doAccounts);
$aExpect = array('default' => 'UTC', 'aAccounts' => array(), 'adminAccountId' => 1);
$aResult = OA_Dal_Delivery_getAccountTZs();
$this->assertEqual($aResult, $aExpect);
$doPreferences = OA_Dal::factoryDO('preferences');
$doPreferences->preference_name = 'timezone';
$preferenceId = $doPreferences->insert();
$doAPA = OA_Dal::factoryDO('account_preference_assoc');
$doAPA->account_id = $adminAccountId;
$doAPA->preference_id = $preferenceId;
$doAPA->value = '';
$doAPA->insert();
$aResult = OA_Dal_Delivery_getAccountTZs();
$this->assertEqual($aResult, $aExpect);
$doAPA = OA_Dal::factoryDO('account_preference_assoc');
$doAPA->account_id = $adminAccountId;
$doAPA->preference_id = $preferenceId;
$doAPA->value = 'Europe/Rome';
$doAPA->update();
$aExpect = array('default' => 'Europe/Rome', 'aAccounts' => array(), 'adminAccountId' => 1);
$aResult = OA_Dal_Delivery_getAccountTZs();
$this->assertEqual($aResult, $aExpect);
// Create a couple of manager accounts
$doAccounts = OA_Dal::factoryDO('accounts');
$doAccounts->account_name = 'Manager Account 1';
$doAccounts->account_type = OA_ACCOUNT_MANAGER;
$managerAccountId1 = DataGenerator::generateOne($doAccounts);
$doAPA = OA_Dal::factoryDO('account_preference_assoc');
$doAPA->account_id = $managerAccountId1;
$doAPA->preference_id = $preferenceId;
$doAPA->value = 'Europe/London';
$doAPA->insert();
$doAccounts = OA_Dal::factoryDO('accounts');
$doAccounts->account_name = 'Manager Account 2';
$doAccounts->account_type = OA_ACCOUNT_MANAGER;
$managerAccountId2 = DataGenerator::generateOne($doAccounts);
$doAPA = OA_Dal::factoryDO('account_preference_assoc');
$doAPA->account_id = $managerAccountId2;
$doAPA->preference_id = $preferenceId;
$doAPA->value = 'CEST';
$doAPA->insert();
$aExpect = array('default' => 'Europe/Rome', 'aAccounts' => array($managerAccountId1 => 'Europe/London', $managerAccountId2 => 'CEST'), 'adminAccountId' => 1);
$aResult = OA_Dal_Delivery_getAccountTZs();
$this->assertEqual($aResult, $aExpect);
}
示例2: MAX_cacheGetAccountTZs
function MAX_cacheGetAccountTZs($cached = true)
{
$sName = OA_Delivery_Cache_getName(__FUNCTION__);
if (!$cached || ($aResult = OA_Delivery_Cache_fetch($sName)) === false) {
MAX_Dal_Delivery_Include();
$aResult = OA_Dal_Delivery_getAccountTZs();
$aResult = OA_Delivery_Cache_store_return($sName, $aResult);
}
return $aResult;
}