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
1 changed files with 9 additions and 0 deletions

View 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()
{