]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/File_to_post.php
scripts/nukefile.php for blasting crap from the server
[quix0rs-gnu-social.git] / classes / File_to_post.php
index 4c751ae4f399d78a70ad9266f4f89ee95540bea2..b3c44d4a224f3a982c468922a050c666c0a0698a 100644 (file)
@@ -85,6 +85,24 @@ class File_to_post extends Managed_DataObject
         }
     }
 
+    static function getNoticeIDsByFile(File $file)
+    {
+        $f2p = new File_to_post();
+
+        $f2p->selectAdd();
+        $f2p->selectAdd('post_id');
+
+        $f2p->file_id = $file->id;
+
+        $ids = array();
+
+        if (!$f2p->find()) {
+            throw new NoResultException($f2p);
+        }
+
+        return $f2p->fetchAll('post_id');
+    }
+
     function delete($useWhere=false)
     {
         $f = File::getKV('id', $this->file_id);