X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/4eb5205070aa564e9aa6acf8f65f4c58363f4bf1..refs/pull/767/head:/app/Repos/ImageRepo.php diff --git a/app/Repos/ImageRepo.php b/app/Repos/ImageRepo.php index 0c15a4310..245c0f27b 100644 --- a/app/Repos/ImageRepo.php +++ b/app/Repos/ImageRepo.php @@ -92,7 +92,7 @@ class ImageRepo * @param string $searchTerm * @return array */ - public function searchPaginatedByType($type, $page = 0, $pageSize = 24, $searchTerm) + public function searchPaginatedByType($type, $searchTerm, $page = 0, $pageSize = 24) { $images = $this->image->where('type', '=', strtolower($type))->where('name', 'LIKE', '%' . $searchTerm . '%'); return $this->returnPaginated($images, $page, $pageSize); @@ -101,13 +101,13 @@ class ImageRepo /** * Get gallery images with a particular filter criteria such as * being within the current book or page. - * @param int $pagination - * @param int $pageSize * @param $filter * @param $pageId + * @param int $pageNum + * @param int $pageSize * @return array */ - public function getGalleryFiltered($pagination = 0, $pageSize = 24, $filter, $pageId) + public function getGalleryFiltered($filter, $pageId, $pageNum = 0, $pageSize = 24) { $images = $this->image->where('type', '=', 'gallery'); @@ -120,7 +120,7 @@ class ImageRepo $images = $images->whereIn('uploaded_to', $validPageIds); } - return $this->returnPaginated($images, $pagination, $pageSize); + return $this->returnPaginated($images, $pageNum, $pageSize); } /** @@ -225,7 +225,6 @@ class ImageRepo try { return $this->imageService->getThumbnail($image, $width, $height, $keepRatio); } catch (\Exception $exception) { - dd($exception); return null; } } @@ -254,5 +253,4 @@ class ImageRepo $validTypes = ['drawing', 'gallery', 'cover', 'system', 'user']; return in_array($type, $validTypes); } - -} \ No newline at end of file +}