X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FFile_thumbnail.php;h=68cb2a737fb2a939e34beebbcfb14e394de78ca2;hb=b9a07330621b8c09339e33779798af46c517b7cd;hp=f789a0d9a1637647efb13307c60be98f80d5fa7c;hpb=15c16ac54e0d9d4c06a40dfc189d22f82152ce8b;p=quix0rs-gnu-social.git diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php index f789a0d9a1..68cb2a737f 100644 --- a/classes/File_thumbnail.php +++ b/classes/File_thumbnail.php @@ -98,6 +98,7 @@ class File_thumbnail extends Managed_DataObject if ($notNullUrl) { $thumb->whereAdd('url IS NOT NULL'); } + $thumb->orderBy('modified ASC'); // the first created, a somewhat ugly hack $thumb->limit(1); if (!$thumb->find(true)) { throw new NoResultException($thumb); @@ -188,7 +189,7 @@ class File_thumbnail extends Managed_DataObject $file_filename = $this->getFile()->getFilename(); } catch (NoResultException $e) { // reasonably the function calling us will handle the following as "File_thumbnail entry should be deleted" - throw FileNotFoundException($thumbpath); + throw new FileNotFoundException($thumbpath); } catch (InvalidFilenameException $e) { // invalid filename in getFile()->getFilename(), just // means the File object isn't stored locally and that @@ -272,6 +273,10 @@ class File_thumbnail extends Managed_DataObject return File::getByID($this->file_id); } + public function getFileId() + { + return $this->file_id; + } static public function hashurl($url) {