本文整理汇总了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);
}