public function init()
{
if (Yii::app()->{$this->connectionId} === null) {
throw new CHttpException(500, 'An active "db" connection is required to run this generator.');
}
$this->tablePrefix = Yii::app()->{$this->connectionId}->tablePrefix;
parent::init();
}