I have a question regarding events: when you define an event (let’s name it onEventMethod()) and you attach to it some handlers, when raiseEvent method for this event is executed, the onEventMethod is never called by the framework (unless called explicitely by you) - the attached handlers are called instead. Am I right?
I am asking because I found such a piece of code in Yii Development Cookbook:
// defining onNewComment event
public function onNewComment($event) {
// Event is actually triggered here. This way we can use
// onNewComment method instead of raiseEvent.
$this->raiseEvent(‘onNewComment’, $event);
}
In case I am wrong, the above code would lead to the endless loop (and callstack overflow).