]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/ActivityModeration/classes/Deleted_notice.php
Using some Managed_DataObject::getByPK calls for consistency
[quix0rs-gnu-social.git] / plugins / ActivityModeration / classes / Deleted_notice.php
index 254d4107211a66b52138fa72830f8f1ffab40b8f..3c6adeb80225cdb6235f57d280a33e4960b58ffc 100644 (file)
@@ -99,12 +99,7 @@ class Deleted_notice extends Managed_DataObject
     static public function fromStored(Notice $stored)
     {
         $class = get_called_class();
-        $object = new $class;
-        $object->uri = $stored->getUri();   // Lookup by delete activity's URI! (that's what is _stored_ in our db!)
-        if (!$object->find(true)) {
-            throw new NoResultException($object);
-        }
-        return $object;
+        return self::getByPK(array('uri', $stored->getUri()));
     }
 
     // The one who deleted the notice, not the notice's author