From 49b7648fea5226f2d3628028dd60088c3b35fe9d Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 10 Feb 2016 03:37:27 +0100 Subject: [PATCH] Managed_DataObject gets onInsert and onUpdate --- classes/Managed_DataObject.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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); + } } -- 2.39.5