From 015e95829b5ca753641791ae11ced31c982631c9 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Fri, 23 Jan 2015 14:46:47 +0100 Subject: [PATCH] MediaFile->getFile() instead of accessing fileRecord --- lib/mediafile.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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() { -- 2.39.5