本文整理匯總了PHP中UserConfig::store方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserConfig::store方法的具體用法?PHP UserConfig::store怎麽用?PHP UserConfig::store使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserConfig
的用法示例。
在下文中一共展示了UserConfig::store方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: up
function up()
{
DBManager::get()->exec("ALTER TABLE `event_data` CHANGE `autor_id` `author_id` VARCHAR(32) NOT NULL");
DBManager::get()->exec("ALTER TABLE `calendar_event` ADD `mkdate` INT NOT NULL AFTER `group_status`");
DBManager::get()->exec("UPDATE calendar_event ce LEFT JOIN event_data ed USING(event_id) SET ce.mkdate = ed.mkdate");
$replace = array('showlist' => 'list', 'showday' => 'day', 'showweek' => 'week', 'showmonth' => 'month', 'showyear' => 'year');
$res = DBManager::get()->query("SELECT user_id FROM `user_config` WHERE field = 'CALENDAR_SETTINGS'");
$default_settings = Calendar::getDefaultUserSettings();
Config::get()->store('CALENDAR_SETTINGS', $default_settings);
foreach ($res as $row) {
$config = new UserConfig($row['user_id']);
$settings = $config->getValue('CALENDAR_SETTINGS');
if (isset($settings['view'])) {
$default_settings['view'] = $replace[$settings['view']];
$config->store('CALENDAR_SETTINGS', $default_settings);
}
}
}