Example #1
1
 public function init()
 {
     parent::init();
     $this->target = Yii::createObject($this->targetClass);
     if (!$this->condition) {
         $this->target = $this->target->findOne($this->condition);
     }
 }
Example #2
0
 /**
  * Инициализация
  * @throws InvalidConfigException
  */
 public function init()
 {
     if (empty($this->attribute)) {
         throw new InvalidConfigException("Class property 'attribute' does`t set");
     }
     parent::init();
 }
 public function init()
 {
     parent::init();
     if (!$this->versionTable) {
         throw new Exception(\Yii::t('app', 'Version table not defined'));
     }
 }
Example #4
0
 /**
  *
  */
 public function init()
 {
     parent::init();
     if (!is_array($this->columnValues) || count($this->columnValues) == 0) {
         throw new \InvalidArgumentException('Нужно задать значения для вывода');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->attributes)) {
         $this->attributes = [BaseActiveRecord::EVENT_AFTER_INSERT => [], BaseActiveRecord::EVENT_BEFORE_UPDATE => [], BaseActiveRecord::EVENT_BEFORE_DELETE => []];
     }
 }
 /**
  * Инициализация
  */
 public function init()
 {
     if (!is_array($this->apps)) {
         $this->apps = [$this->apps];
     }
     parent::init();
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (is_null($this->values)) {
         $this->values = time();
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->attributes)) {
         throw new InvalidConfigException('The "attributes" property must be set.');
     }
 }
Example #9
0
 public function init()
 {
     parent::init();
     if (!is_array($this->attributes)) {
         $this->attributes = [$this->attributes];
     }
 }
 public function init()
 {
     if (!is_array($this->counters)) {
         throw new InvalidParamException('counters property should be array');
     }
     return parent::init();
 }
 /**
  * Init
  */
 public function init()
 {
     if ($this->attributes == null) {
         throw new InvalidConfigException('Property "attributes" must be set');
     }
     parent::init();
 }
 /**
  * Invokes init of parent class and assigns proper values to internal _fields variable
  */
 public function init()
 {
     parent::init();
     //configure _fields
     foreach ($this->relations as $attributeName => $params) {
         //add primary field
         $this->_fields[$attributeName] = ['attribute' => $attributeName];
         if (isset($params['get'])) {
             $this->_fields[$attributeName]['get'] = $params['get'];
         }
         if (isset($params['set'])) {
             $this->_fields[$attributeName]['set'] = $params['set'];
         }
         //add secondary fields
         if (isset($params['fields'])) {
             foreach ($params['fields'] as $fieldName => $params) {
                 $fullFieldName = $attributeName . '_' . $fieldName;
                 if (isset($this->_fields[$fullFieldName])) {
                     throw new ErrorException("Ambiguous field name definition: {$fullFieldName}");
                 }
                 $this->_fields[$fullFieldName] = ['attribute' => $attributeName];
                 if (isset($params['get'])) {
                     $this->_fields[$fullFieldName]['get'] = $params['get'];
                 }
                 if (isset($params['set'])) {
                     $this->_fields[$fullFieldName]['set'] = $params['set'];
                 }
             }
         }
     }
 }
 public function init()
 {
     if (is_null($this->generators)) {
         $this->generators = $this->defaultGenerators();
     }
     parent::init();
 }
Example #14
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->related === null) {
         throw new InvalidConfigException('The "related" property must be set.');
     }
 }
Example #15
0
 public function init()
 {
     parent::init();
     if (!$this->meta) {
         $this->meta = ['title' => 'title'];
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->owner->canGetProperty('idAttribute')) {
         throw new \LogicException("Model {$this->owner->className()} has not 'idAttribute' property");
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->classes)) {
         throw new InvalidConfigException('"classes" param must be provided');
     }
 }
 /**
  * @throws IntegrityException
  */
 public function init()
 {
     if (!$this->attribute) {
         throw new IntegrityException('Attribute is not defined');
     }
     parent::init();
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->mode === self::MODE_EVENT) {
         throw new Exception('TrackableBehavior does not yet support events.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->copyTo)) {
         throw new InvalidConfigException('attribute copyTo must be provided');
     }
 }
 public function init()
 {
     parent::init();
     if (\Yii::$app->session->get('browserError') == 1) {
         throw new \yii\web\MethodNotAllowedHttpException(Yii::t('app', 'You are not dddallowed to access this page.'));
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->sessionVarName)) {
         throw new InvalidConfigException('The $sessionVarName should be configured for this behavior.');
     }
 }
Example #23
0
 public function init()
 {
     parent::init();
     //检查配置
     if ($this->offlinUrl !== null) {
     }
 }
Example #24
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->app_id || !$this->mch_id || !$this->app_key || !$this->app_secret) {
         throw new InvalidConfigException("WxPay::app_id & mch_id & app_key & app_secret are required to be configured.");
     }
 }
Example #25
0
 public function init()
 {
     parent::init();
     $mark = $this->multiple ? UploadStrategyFactory::UPLOAD_MULTIPLE : UploadStrategyFactory::UPLOAD_SINGLE;
     $this->uploadStrategy = UploadStrategyFactory::get($mark);
     $this->uploadStrategy->setBehavior($this);
 }
 public function init()
 {
     parent::init();
     if ($this->plugins === null) {
         throw new InvalidConfigException("plugins property can not be empty.");
     }
 }
 public function init()
 {
     parent::init();
     if (empty($this->relatedFind)) {
         $relatedModel = $this->relatedModel;
         $this->relatedFind = $relatedModel::find();
     }
 }
 public function init()
 {
     parent::init();
     if ($this->_eventStore === null) {
         $this->_eventStore = Yii::$app->eventStore;
     }
     $this->_eventsToPublish = new SplQueue();
 }
 public function init()
 {
     parent::init();
     $this->_params = ArrayHelper::map(\app\models\ParamTypes::getAllParams(), 'id', 'name');
     if ($this->field == '') {
         throw new \yii\base\InvalidConfigException("Не задан параметр {$field}");
     }
 }
 /**
  * Get languages and default language from params if they are not set explicitly
  */
 public function init()
 {
     parent::init();
     $this->mlConfig['default_language'] = Yii::$app->params['mlConfig']['default_language'];
     if (!isset($this->mlConfig['languages'])) {
         $this->mlConfig['languages'] = Yii::$app->params['mlConfig']['languages'];
     }
 }