- /**
- * Search for images by query, of a particular type.
- * @param string $type
- * @param int $page
- * @param int $pageSize
- * @param string $searchTerm
- * @return array
- */
- public function searchPaginatedByType(Request $request, $type, $searchTerm, $page = 0, $pageSize = 24)
- {
- // TODO - Filter by uploaded_to
- $images = $this->image->newQuery()
- ->where('type', '=', strtolower($type))
- ->where('name', 'LIKE', '%' . $searchTerm . '%');
-
- if ($type === 'gallery') {
- $images = $this->restrictionService->filterRelatedPages($images, 'images', 'uploaded_to');