fuel/orm — pull request #125 by johnnyfreeman (2011-12-07 04:58:35+00:00)
Title: Pull request for Issue #124. (Observer registration from OUTSIDE of the Model)

Original Issue here:

I have a feature request. Currently, you can register an observer by adding something like this to your model:

```
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
);
}
```

But, what I want to do is, register an observer for a model OUTSIDE of the model, not inside the model like in the code shown above.

Something like how the Event class works I guess. Theoretically, I would have to register the observer somewhere like so:

`Model_Comment::register_observer('Observer_Akismet', array('events' => array('before_save')));`