]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Managed_DataObject gets onInsert and onUpdate
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 10 Feb 2016 02:37:27 +0000 (03:37 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 10 Feb 2016 02:37:27 +0000 (03:37 +0100)
classes/Managed_DataObject.php

index 28e7e1b658973421b9031f8c885d8c0076ef8b7f..31ae6614fbd971872a3da0f27e1261c1cd076ac9 100644 (file)
@@ -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);
+    }
 }