public function validateConnectionId($attribute, $params)
    {
        $db = \Yii::app()->getComponent($this->connectionId);
        if ($db === null || !($db instanceof \CDbConnection)) {
            $this->addError('connectionId', 'A valid database connection is required to run this generator.');
        }
    }