Skip to content
Snippets Groups Projects

add events notifications

Merged Patrick Barroca requested to merge sandbox-journal-observer into master
2 unresolved threads
Files
5
@@ -268,13 +268,19 @@ abstract class Storm_Model_Abstract {
$this->_updateNullBelongsToIdFieldsFromDependents();
if ($valid = $this->isValid()) {
$this->saveWithoutValidation();
$this->_attributes_in_db=$this->_attributes;
$this->_getEvents()->notify(new Storm_Event($this));
$this->_attributes_in_db = $this->_attributes;
}
return $valid;
}
protected function _getEvents() {
return Storm_Events::getInstance();
}
public function assertSave() {
if (!$this->save())
throw new Storm_Model_Exception('Can\'t save '.get_class($this).': '.implode(',',$this->getErrors()));