yupe\components\WebModule::getSettings PHP Method

getSettings() public method

Получаем настройки модуля:
public getSettings ( boolean $needReset = false ) : void
$needReset boolean необходимо ли сбросить настройки
return void
    public function getSettings($needReset = false)
    {
        if ($needReset) {
            Yii::app()->getCache()->clear($this->getId());
        }
        try {
            $settingsRows = Yii::app()->db->cache($this->coreCacheTime, new \TagsCache($this->getId(), 'settings'))->createCommand('
                    SELECT param_name, param_value
                        FROM {{yupe_settings}}
                        WHERE module_id = :module_id AND type = :type
                    ')->bindValue(':module_id', $this->getId())->bindValue(':type', Settings::TYPE_CORE)->queryAll();
            if (!empty($settingsRows)) {
                foreach ($settingsRows as $sRow) {
                    if (property_exists($this, $sRow['param_name'])) {
                        $this->{$sRow['param_name']} = $sRow['param_value'];
                    }
                }
            }
            return true;
        } catch (CDbException $e) {
            return false;
        }
    }