class Model_Comment extends \Orm\Model { protected static $_properties = array('id', 'email', 'url', 'content'); protected static $_table_name = 'comments'; protected static $_observers = array( 'example', // will call Observer_Example class for all events 'Orm\\Observer_CreatedOn' => array('before_insert'), // will only call Orm\Observer_CreatedOn at before_insert event ); }
Model_Comment::register_observer('Observer_Akismet', array('events' => array('before_save')));
It looks like you're new here. If you want to get involved, click one of these buttons!