/** * @inheritdoc */ public function init() { parent::init(); if ($this->modelClass === null && $this->tableName === null) { throw new InvalidConfigException('Either "modelClass" or "tableName" must be set.'); } }
/** * @inheritdoc */ public function init() { parent::init(); if (!isset($this->modelClass) && !isset($this->tableName)) { throw new InvalidConfigException('Either "modelClass" or "tableName" must be set.'); } }
public function init() { parent::init(); /** @var ActiveRecord $model */ $model = $this->modelClass; $this->index || ($this->index = $model::index()); $this->type || ($this->type = $model::type()); if (empty($this->type) || empty($this->index)) { throw new InvalidParamException('"index" and "type" must be specified'); } }
/** * @inheritdoc */ public function init() { parent::init(); if (!isset($this->modelClass) && (!isset($this->index) || !isset($this->type))) { throw new InvalidConfigException('Either "modelClass" or "index" and "type" must be set.'); } /* @var $modelClass ActiveRecord */ $modelClass = $this->modelClass; if ($this->index === null) { $this->index = $modelClass::index(); } if ($this->type === null) { $this->type = $modelClass::type(); } }