]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
MediaFile->getFile() instead of accessing fileRecord
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 23 Jan 2015 13:46:47 +0000 (14:46 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 23 Jan 2015 13:46:47 +0000 (14:46 +0100)
lib/mediafile.php

index 6dd2e79035cb6dd85ddf9b7c954172794458ffb3..3bbbd162f0c18985d7cfc6238ab2b2d39854d8a5 100644 (file)
@@ -79,6 +79,15 @@ class MediaFile
         @unlink($filepath);
     }
 
+    public function getFile()
+    {
+        if (!$this->fileRecord instanceof File) {
+            throw new ServerException('File record did not exist for MediaFile');
+        }
+
+        return $this->fileRecord;
+    }
+
     protected function storeFile()
     {