Attaching Event Handler Inside Model

By following way can not attach static event handler inside itself model:


class model extends CActiveRecord

{


	$this->onTest=array($this,'staticHandler');


	public static function staticHandler()	{

		print "This is static handler.\n";

	}	


	public function onTest($event)	{

	   $this->raiseEvent('onTest',$event);

	}

}

Is possible attaching an event handler inside model?how to?

How you attach event handler inside the model?