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.'); } }