I am using the observer feature in which I want to set some data to be inserted into a table along with my submitted form data. Not all data in the table is filled out in the form, but based on options chosen, fields need to set.
class Model_Genre extends \Orm\Model
{
protected static $_properties = array(
'id',
'name',
'user_id',
'created_at',
'updated_at',
'lft',
'rgt',
'slug'
);
protected static $_observers = array(
'Orm\Observer_Self' => array(
'events' => array('before_save'),
)
)
public function _event_before_save() {
self::$_properties['lft'] = 100;
}
}
Just as a test, I wanted to see if this was setting my lft column to 100. But it does not seem to be firing since this column is NULL once its gets inserted.