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


PHP Setting::findAll方法代码示例

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


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

示例1: disable

 /**
  * Disables a module
  * 
  * This should delete all data created by this module.
  * When override this method make sure to invoke the parent implementation AFTER your implementation.
  */
 public function disable()
 {
     /**
      * Remove database tables
      */
     $migrationPath = $this->getBasePath() . '/migrations';
     $uninstallMigration = $migrationPath . '/uninstall.php';
     if (file_exists($uninstallMigration)) {
         /**
          * Execute Uninstall Migration
          */
         ob_start();
         require_once $uninstallMigration;
         $migration = new \uninstall();
         try {
             $migration->up();
         } catch (\yii\db\Exception $ex) {
         }
         ob_get_clean();
         /**
          * Delete all Migration Table Entries
          */
         $migrations = opendir($migrationPath);
         while (false !== ($migration = readdir($migrations))) {
             if ($migration == '.' || $migration == '..' || $migration == 'uninstall.php') {
                 continue;
             }
             Yii::$app->db->createCommand()->delete('migration', ['version' => str_replace('.php', '', $migration)])->execute();
         }
     }
     foreach (\humhub\modules\content\models\ContentContainerSetting::findAll(['module_id' => $this->id]) as $containerSetting) {
         $containerSetting->delete();
     }
     foreach (\humhub\models\Setting::findAll(['module_id' => $this->id]) as $containerSetting) {
         $containerSetting->delete();
     }
     foreach (\humhub\modules\user\models\Module::findAll(['module_id' => $this->id]) as $userModule) {
         $userModule->delete();
     }
     foreach (\humhub\modules\space\models\Module::findAll(['module_id' => $this->id]) as $spaceModule) {
         $spaceModule->delete();
     }
     Yii::$app->moduleManager->disable($this);
 }
开发者ID:kreativmind,项目名称:humhub,代码行数:50,代码来源:Module.php


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