MediaFile->getFile() instead of accessing fileRecord

This commit is contained in:
Mikael Nordfeldth 2015-01-23 14:46:47 +01:00
parent 6f410eda5c
commit 015e95829b

View File

@ -79,6 +79,15 @@ class MediaFile
@unlink($filepath); @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() protected function storeFile()
{ {