init() публичный Метод

This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
public init ( )
Пример #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if ($this->db === null) {
         $this->db = new Connection(['dsn' => 'sqlite:' . Yii::getAlias($this->dbFile)]);
     }
     parent::init();
     if ($this->autoCreateTable && !$this->db->getTableSchema($this->cacheTable)) {
         $this->createTableCache();
     }
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->createTable();
 }