From: Cameron Ball Date: Thu, 19 Feb 2015 06:04:02 +0000 (+0800) Subject: Bugfix X-Git-Url: http://git.cameron1729.xyz/?p=rock.divinelegy.git;a=commitdiff_plain;h=008cb18b8f68f207fc965dd8c0cc129feab60d58 Bugfix --- diff --git a/DataAccess/FileRepository.php b/DataAccess/FileRepository.php index 74d44b3..74cb212 100644 --- a/DataAccess/FileRepository.php +++ b/DataAccess/FileRepository.php @@ -56,8 +56,16 @@ class FileRepository implements IFileRepository 'File', $queryBuilder ); - - return reset($results); + + //XXX: Hack. Sometimes instead of getting a real array back we get the + //lazyload thing because I was an idiot with the database. Originally + //I simply did return reset($results) but if we don't have an array that + //won't work. So instead do a foreach (lazyload thing is iterable) and just + //return the first element. + foreach($results as $result) + { + return $result; + } } public function save(\Domain\Entities\IFile $file) {