This page explains how to implement an event and catch that event in a behavior.

To understand what happends you should know or have an idea of what behaviors and events are. If not just quicky read "that wiki page."

Let's begin!

We have a CActiveRecordModel named party . Users can register to a party.

What we want to do is create a behavior to send notification to the party manager. Because we don't want our party model to manage notifications we will separate party model and notification model ( we also know that the way we will deal with nofications can change and be complexe ).
So what we can do is attach a behavior to party . That behavior will manage notifications. For example when a user register to a party.