/** * @return string */ public function run() { if ($this->model->hasProperty('mlConfig') and count($this->model->mlConfig['languages']) > 1) { return $this->render('multi'); } else { return $this->render('single'); } }
public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($insert) { $this->mailAdmin(); } }
public function afterDelete() { parent::afterDelete(); foreach ($this->getItems()->all() as $item) { $item->delete(); } }
public function afterDelete() { parent::afterDelete(); if ($this->image) { @unlink(Yii::getAlias('@webroot') . $this->image); } }
public function afterDelete() { parent::afterDelete(); //@unlink(Yii::getAlias('@webroot').$this->file); foreach (array_keys(Yii::$app->params['mlConfig']['languages']) as $lang) { $file_lang = $lang != Yii::$app->params['mlConfig']['default_language'] ? 'file_' . $lang : 'file'; @unlink(Yii::getAlias('@webroot') . $this->{$file_lang}); } }
public function afterDelete() { parent::afterDelete(); foreach ($this->getItems()->all() as $item) { $item->delete(); } if ($this->thumb) { @unlink(Yii::getAlias('@webroot') . $this->thumb); } }
public function afterDelete() { parent::afterDelete(); if ($this->image) { @unlink(Yii::getAlias('@webroot') . $this->image); } foreach ($this->getPhotos()->all() as $photo) { $photo->delete(); } }
public function afterDelete() { parent::afterDelete(); foreach ($this->getPhotos()->all() as $photo) { $photo->delete(); } if ($this->image) { @unlink(Yii::getAlias('@webroot') . $this->image); } ItemData::deleteAll(['item_id' => $this->primaryKey]); }
public function beforeSave($insert) { if (parent::beforeSave($insert)) { if ($insert) { $this->ip = Yii::$app->request->userIP; $this->time = time(); } return true; } else { return false; } }
public function beforeSave($insert) { if (parent::beforeSave($insert)) { if ($this->isNewRecord) { $this->auth_key = $this->generateAuthKey(); $this->password = $this->hashPassword($this->password); } else { $this->password = $this->password != '' ? $this->hashPassword($this->password) : $this->oldAttributes['password']; } return true; } else { return false; } }
public function beforeSave($insert) { if (parent::beforeSave($insert)) { if ($insert) { $this->ip = Yii::$app->request->userIP; $this->time = time(); $this->new = 1; $this->status = Yii::$app->getModule('admin')->activeModules['guestbook']->settings['preModerate'] ? self::STATUS_OFF : self::STATUS_ON; } return true; } else { return false; } }
public static function get($name) { if (!self::$_data) { self::$_data = Data::cache(self::CACHE_KEY, 3600, function () { $result = []; try { foreach (parent::find()->all() as $setting) { $result[$setting->name] = $setting->value; } } catch (\yii\db\Exception $e) { } return $result; }); } return isset(self::$_data[$name]) ? self::$_data[$name] : null; }
public function afterDelete() { parent::afterDelete(); }
public function afterDelete() { parent::afterDelete(); @unlink(Yii::getAlias('@webroot') . $this->file); }
public function behaviors() { return array_merge_recursive(parent::behaviors(), ['seoBehavior' => SeoBehavior::className()]); }
public function afterFind() { parent::afterFind(); $this->settings = $this->settings !== '' ? json_decode($this->settings, true) : $this->getDefaultSettings(); $this->syncSettings(); }
public function behaviors() { return array_merge_recursive(parent::behaviors(), ['cn' => ['class' => CalculateNotice::className(), 'callback' => function () { return self::find()->status(self::STATUS_NEW)->count(); }]]); }
public function afterFind() { parent::afterFind(); $this->settings = $this->settings !== '' ? json_decode($this->settings, true) : self::getDefaultSettings($this->name); }
public function __set($name, $value) { $fields = FeedbackModule::getFormFields(); if (isset($fields[$name])) { $data = $this->getData(); $data[$name] = $value; $this->setData($data); return; } parent::__set($name, $value); }
public function afterFind() { parent::afterFind(); $this->parseItems(); }
/** * @inheritDoc */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), ['url' => 'URL', 'h1' => 'H1', 'page_description' => 'Описание страницы']); }
public function afterDelete() { parent::afterDelete(); foreach ($this->getGoods()->all() as $good) { $good->delete(); } }