/**
  * Initializes the DB connection component.
  * This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
  * @throws InvalidConfigException if [[db]] is invalid.
  */
 public function init()
 {
     parent::init();
     if (is_string($this->db)) {
         $this->db = Instance::ensure($this->db, Connection::className());
     }
 }
Beispiel #2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->kurs instanceof Kurs) {
         throw new InvalidConfigException();
     }
 }
Beispiel #3
0
 public function init()
 {
     parent::init();
     $meta = $this->data['_meta'];
     $this->totalCount = $meta['totalCount'];
     $this->pagination = ['totalCount' => $meta['totalCount'], 'pageSize' => $meta['perPage']];
 }
 public function init()
 {
     parent::init();
     if (is_string($this->solr)) {
         $this->solr = Instance::ensure($this->solr, Connection::className());
     } elseif ($this->solr === null) {
         $this->solr = Instance::ensure('solr', Client::className());
     }
 }
 /**
  * Initializes the DB connection component.
  * This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
  * @throws InvalidConfigException if [[db]] is invalid.
  */
 public function init()
 {
     parent::init();
     if (is_string($this->db)) {
         $this->db = Yii::$app->getComponent($this->db);
         if ($this->db === null) {
             throw new InvalidConfigException('The "db" property must be a valid DB Connection application component.');
         }
     }
 }
Beispiel #6
0
 /**
  * Initializes the DB connection component.
  * This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
  * @throws InvalidConfigException if [[db]] is invalid.
  */
 public function init()
 {
     parent::init();
     $this->db = Instance::ensure($this->db, Connection::className());
     if ($this->sql === null) {
         throw new InvalidConfigException('The "sql" property must be set.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // open file
     //$this->fileObject = new SplFileObject($this->filename);
 }