From: Mikael Nordfeldth Date: Fri, 23 Jan 2015 13:46:47 +0000 (+0100) Subject: MediaFile->getFile() instead of accessing fileRecord X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=015e95829b5ca753641791ae11ced31c982631c9;p=quix0rs-gnu-social.git MediaFile->getFile() instead of accessing fileRecord --- diff --git a/lib/mediafile.php b/lib/mediafile.php index 6dd2e79035..3bbbd162f0 100644 --- a/lib/mediafile.php +++ b/lib/mediafile.php @@ -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() {