/**
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if ($this->modelClass === null) {
         throw new InvalidConfigException('Model class should be set');
     }
     if ($this->type === null) {
         throw new InvalidConfigException('Auth item type should be set');
     }
 }
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['update' => ['class' => EditableColumnAction::className(), 'modelClass' => Language::className(), 'findModel' => function ($id, $action) {
         $language = Language::findOne($id);
         $language->scenario = 'update';
         return $language;
     }, 'outputValue' => function ($model, $attribute, $key, $index) {
         return $model->{$attribute};
     }, 'outputMessage' => function ($model, $attribute, $key, $index) {
         return '';
     }, 'showModelErrors' => true, 'errorOptions' => ['header' => '']]]);
 }
Esempio n. 3
0
 /**
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if ($this->modelClass === null) {
         throw new InvalidConfigException('Model class should be set');
     }
     if ($this->formClass === null) {
         throw new InvalidConfigException('Form class should be set');
     }
     if ($this->searchClass === null) {
         throw new InvalidConfigException('Search class should be set');
     }
 }
Esempio n. 4
0
 /**
  * @param string  $id
  * @param BaseModule $module
  * @param UserFinder  $finder
  * @param array   $config
  */
 public function __construct($id, $module, UserFinder $finder, $config = [])
 {
     $this->finder = $finder;
     parent::__construct($id, $module, $config);
 }