protected function getDbConnection() { if (Yii::$container->has($this->db)) { return Yii::$container->get($this->db); } else { return Yii::$app->get($this->db); } }