]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
newUri might as well be put in Managed_DataObject
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 10 Oct 2015 19:31:26 +0000 (21:31 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 10 Oct 2015 19:31:26 +0000 (21:31 +0200)
classes/Managed_DataObject.php
plugins/ActivityModeration/classes/Deleted_notice.php
plugins/Favorite/classes/Fave.php

index ec514029939547997f5e098925e79816868d0034..e645b5aec9fa317717f953107c3f3b90cfb27888 100644 (file)
@@ -453,4 +453,16 @@ abstract class Managed_DataObject extends Memcached_DataObject
     {
         // NOOP
     }
+
+    static function newUri(Profile $actor, Managed_DataObject $object, $created=null)
+    {
+        if (is_null($created)) {
+            $created = common_sql_now();
+        }
+        return TagURI::mint(strtolower(get_called_class()).':%d:%s:%d:%s',
+                                        $actor->getID(),
+                                        ActivityUtils::resolveUri($object->getObjectType(), true),
+                                        $object->getID(),
+                                        common_date_iso8601($created));
+    }
 }
index b7413cfb27d606d8647a4a145196871d0e60fdf5..254d4107211a66b52138fa72830f8f1ffab40b8f 100644 (file)
@@ -175,18 +175,6 @@ class Deleted_notice extends Managed_DataObject
         $act->title = ActivityUtils::verbToTitle($act->verb);
     }
 
-    static function newUri(Profile $actor, Managed_DataObject $object, $created=null)
-    {
-        if (is_null($created)) {
-            $created = common_sql_now();
-        }
-        return TagURI::mint(strtolower(get_called_class()).':%d:%s:%d:%s',
-                                        $actor->getID(),
-                                        ActivityUtils::resolveUri($object->getObjectType(), true),
-                                        $object->getID(),
-                                        common_date_iso8601($created));
-    }
-
     static public function beforeSchemaUpdate()
     {
         $table = strtolower(get_called_class());
index 1e011decf8d74bca5723d45031911eaf12e2044a..ad7cc67df86ebccd10b9ac7c3a1a37430368cd77 100644 (file)
@@ -440,16 +440,4 @@ class Fave extends Managed_DataObject
         // We (should've in this case) created it ourselves, so we tag it ourselves
         return self::newUri($this->getActor(), $this->getTarget(), $this->created);
     }
-
-    static function newUri(Profile $actor, Managed_DataObject $target, $created=null)
-    {
-        if (is_null($created)) {
-            $created = common_sql_now();
-        }
-        return TagURI::mint(strtolower(get_called_class()).':%d:%s:%d:%s',
-                                        $actor->id,
-                                        ActivityUtils::resolveUri(self::getObjectType(), true),
-                                        $target->id,
-                                        common_date_iso8601($created));
-    }
 }