Managed_DataObject gets onInsert and onUpdate

This commit is contained in:
Mikael Nordfeldth 2016-02-10 03:37:27 +01:00
parent d0b2d86ca1
commit 49b7648fea

View File

@ -515,4 +515,26 @@ abstract class Managed_DataObject extends Memcached_DataObject
$object->getID(), $object->getID(),
common_date_iso8601($created)); common_date_iso8601($created));
} }
protected function onInsert()
{
// NOOP by default
}
protected function onUpdate($dataObject=false)
{
// NOOP by default
}
public function insert()
{
$this->onInsert();
return parent::insert();
}
public function update($dataObject=false)
{
$this->onUpdate($dataObject);
return parent::update($dataObject);
}
} }