当前位置: 首页>>代码示例>>PHP>>正文


PHP HSetting::isInstalled方法代码示例

本文整理汇总了PHP中HSetting::isInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP HSetting::isInstalled方法的具体用法?PHP HSetting::isInstalled怎么用?PHP HSetting::isInstalled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HSetting的用法示例。


在下文中一共展示了HSetting::isInstalled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: up

 public function up()
 {
     if (HSetting::isInstalled()) {
         $this->alterColumn('profile', 'zip', 'VARCHAR(10) DEFAULT NULL');
         $this->update('profile_field', array('field_type_class' => 'ProfileFieldTypeText', 'field_type_config' => '{"minLength":null,"maxLength":10,"validator":null,"default":null,"regexp":null,"regexpErrorMessage":null}'), 'internal_name="zip"');
     }
 }
开发者ID:alefernie,项目名称:intranet,代码行数:7,代码来源:m140907_140822_zip_field_to_text.php

示例2: up

 public function up()
 {
     $connection = $this->getDbConnection();
     $command = $connection->commandBuilder->createFindCommand('user', new CDbCriteria());
     $reader = $command->query();
     foreach ($reader as $row) {
         // Ignore deleted users
         if ($row['status'] == 3) {
             continue;
         }
         $userId = $row['id'];
         $receive_email_notifications = $row['receive_email_notifications'];
         $receive_email_messaging = $row['receive_email_messaging'];
         $receive_email_activities = $row['receive_email_activities'];
         $insertCommand = $connection->commandBuilder->createInsertCommand('user_setting', array('user_id' => $userId, 'module_id' => 'core', 'name' => 'receive_email_notifications', 'value' => $receive_email_notifications));
         $insertCommand->execute();
         $insertCommand = $connection->commandBuilder->createInsertCommand('user_setting', array('user_id' => $userId, 'module_id' => 'core', 'name' => 'receive_email_messaging', 'value' => $receive_email_messaging));
         $insertCommand->execute();
         $insertCommand = $connection->commandBuilder->createInsertCommand('user_setting', array('user_id' => $userId, 'module_id' => 'core', 'name' => 'receive_email_activities', 'value' => $receive_email_activities));
         $insertCommand->execute();
     }
     $this->dropColumn('user', 'receive_email_notifications');
     $this->dropColumn('user', 'receive_email_messaging');
     $this->dropColumn('user', 'receive_email_activities');
     if (HSetting::isInstalled()) {
         $this->insert('setting', array('name' => 'receive_email_activities', 'value' => '1', 'name' => 'mailing'));
         $this->insert('setting', array('name' => 'receive_email_notifications', 'value' => '2', 'name' => 'mailing'));
     }
 }
开发者ID:alefernie,项目名称:intranet,代码行数:29,代码来源:m140705_065525_emailing_settings.php

示例3: up

 public function up()
 {
     if (HSetting::isInstalled()) {
         $this->insert('setting', array('name' => 'enable_html5_desktop_notifications', 'value' => 0, 'module_id' => 'notification'));
     }
     $this->addColumn('notification', 'desktop_notified', 'tinyint(1) DEFAULT 0');
     $this->update('notification', array('desktop_notified' => 1));
 }
开发者ID:skapl,项目名称:design,代码行数:8,代码来源:m150204_103433_html5_notified.php

示例4: up

 public function up()
 {
     // Check if the installer already ran when not create new profile field
     // (Typically the installer creates initial data.)
     if (HSetting::isInstalled()) {
         $db = $this->getDbConnection();
         // Get "General" Category Group Id
         $categoryId = $db->createCommand()->select('id')->from('profile_field_category')->where('title=:title', array(':title' => 'General'))->queryScalar();
         // Check if we got a category Id
         if ($categoryId == "") {
             throw new CException("Could not find 'General' profile field category!");
         }
         // Create manually profile field
         $insertCommand = $db->commandBuilder->createInsertCommand('profile_field', array('profile_field_category_id' => $categoryId, 'field_type_class' => 'ProfileFieldTypeSelect', 'field_type_config' => '{"options":"male=>Male\\r\\nfemale=>Female\\r\\ncustom=>Custom"}', 'internal_name' => 'gender', 'title' => 'Gender', 'sort_order' => '350', 'editable' => '1', 'visible' => '1', 'show_at_registration' => '0', 'required' => '0'));
         $insertCommand->execute();
         // Create column for profile field
         $this->addColumn('profile', 'gender', 'varchar(255) DEFAULT NULL');
     }
 }
开发者ID:alefernie,项目名称:intranet,代码行数:19,代码来源:m140701_000611_profile_genderfield.php

示例5: up

 public function up()
 {
     // Check if the installer already ran when not create new profile field
     // (Typically the installer creates initial data.)
     if (HSetting::isInstalled()) {
         $db = $this->getDbConnection();
         // Get "General" Category Group Id
         $categoryId = $db->createCommand()->select('id')->from('profile_field_category')->where('title=:title', array(':title' => 'General'))->queryScalar();
         // Check if we got a category Id
         if ($categoryId == "") {
             throw new CException("Could not find 'General' profile field category!");
         }
         // Create manually profile field
         $insertCommand = $db->commandBuilder->createInsertCommand('profile_field', array('profile_field_category_id' => $categoryId, 'field_type_class' => 'ProfileFieldTypeBirthday', 'field_type_config' => '', 'internal_name' => 'birthday', 'title' => 'Birthday', 'sort_order' => '850', 'editable' => '1', 'is_system' => '1', 'visible' => '1', 'show_at_registration' => '0', 'required' => '0'));
         $insertCommand->execute();
         // Create columns for profile field
         $this->addColumn('profile', 'birthday', 'DATETIME DEFAULT NULL');
         $this->addColumn('profile', 'birthday_hide_year', 'INT(1) DEFAULT NULL');
     }
 }
开发者ID:alefernie,项目名称:intranet,代码行数:20,代码来源:m140703_104527_profile_birthdayfield.php

示例6: up

 public function up()
 {
     if (HSetting::isInstalled()) {
         $this->insert('setting', array('name' => 'installationId', 'value' => md5(uniqid("", true)), 'module_id' => 'admin'));
     }
 }
开发者ID:alefernie,项目名称:intranet,代码行数:6,代码来源:m140704_080659_installationid.php


注:本文中的HSetting::isInstalled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。