How to attach event with PHP OOP

Hello,
I need your help with attach event (PHP OOP). I don’t know how to do this:

//This function I have tried inside/outside Class
function doOnAfterAction($action) {
$action->set_response_text(‘lalala’);
}

//how to do this line
$data->event->attach(“AfterUpdate”, doOnAfterAction);

I have tried:
$data->event->attach(“AfterUpdate”, “doOnAfterAction”);
$data->event->attach(“AfterUpdate”, doOnAfterAction);
$data->event->attach(“AfterUpdate”, doOnAfterAction());
$data->event->attach(“AfterUpdate”, $this->doOnAfterAction);
$data->event->attach(“AfterUpdate”, $this->doOnAfterAction());

Always got error "Incorrect function assigned " , “Missing Parameter for $action”

Thanks

Sorry, found solution by myself

[code]class myController extends Controller {
public function data() {

$form->event->attach(new Event());
$form->render_table(‘cds’, ‘id’, ‘titel,interpret,jahr’);
}
}

class Event {
public function afterUpdate($action) {
$action->set_response_text(‘lalala’);
}
}[/code]