/** * Initializes the DB connection component. * This method will initialize the [[db]] property to make sure it refers to a valid DB connection. * @return void * @throws InvalidConfigException If [[db]] is invalid. */ public function init() { parent::init(); if (is_string($this->db)) { $this->db = Instance::ensure($this->db, Connection::className()); } }