Exemplo n.º 1
0
 /**
  * @return bool
  */
 public function save($validate = true)
 {
     if ($validate && !$this->validate()) {
         return false;
     }
     return ParamsManager::getInstance()->manager->staticParams('change', Module::getInstance()->settingsKey, $this->getAttributes());
 }
Exemplo n.º 2
0
 /**
  * @return bool
  */
 public function save()
 {
     if (!isset(Yii::$app->params[Module::getInstance()->settingsKey])) {
         $path = Yii::getAlias('@webroot/files/common') . '/';
         if (!is_file($path . 'underconstruction.jpg')) {
             FileHelper::createDirectory($path);
             copy(Yii::getAlias('@webroot/modules/admunderconst/assets/images/underconstruction.jpg'), $path . 'underconstruction.jpg');
         }
     }
     return ParamsManager::getInstance()->manager->staticParams('change', Module::getInstance()->settingsKey, $this->getAttributes());
 }
 /**
  * Finds the Params model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Params the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     $model = Module::getInstance()->manager->createParamsQuery('find')->where(['id' => $id])->one();
     if ($model !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 4
0
 /**
  * @return bool
  */
 public function save()
 {
     return ParamsManager::getInstance()->manager->staticParams('change', Module::getInstance()->settingsKey, $this->getAttributes());
 }