You should read this :
http://www.yiiframework.com/doc/guide/1.1/en/topics.gii#extending-gii
Gii can be extended in two ways: customizing the code templates of the existing code generators, and writing new code generators.
But a proper way for adding a custom method to all your models is to extends CActiveRecord, and modify Gii template accordingly.