From: Mikael Nordfeldth Date: Wed, 10 Feb 2016 02:37:27 +0000 (+0100) Subject: Managed_DataObject gets onInsert and onUpdate X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=49b7648fea5226f2d3628028dd60088c3b35fe9d;p=quix0rs-gnu-social.git Managed_DataObject gets onInsert and onUpdate --- diff --git a/classes/Managed_DataObject.php b/classes/Managed_DataObject.php index 28e7e1b658..31ae6614fb 100644 --- a/classes/Managed_DataObject.php +++ b/classes/Managed_DataObject.php @@ -515,4 +515,26 @@ abstract class Managed_DataObject extends Memcached_DataObject $object->getID(), 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); + } }