Rather than copying the whole code from a class, why not extend the csqldataprovider.php class and then, in your new class, write your own custom functions?
PHP documentation on extending a class
StackOverflow - where to place your custom classes files in Yii