mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
MINOR Using new PaginatedList API in searchEngine() (if available)
This commit is contained in:
parent
294c0d5c6d
commit
61820b08de
@ -935,10 +935,18 @@ class SQLite3Database extends SS_Database {
|
||||
$objects[] = new $record['ClassName']($record);
|
||||
|
||||
if(isset($objects)) $doSet = new DataObjectSet($objects);
|
||||
else $doSet = new DataObjectSet();
|
||||
else $doSet = new DataObjectSet();
|
||||
|
||||
$doSet->setPageLimits($start, $pageLength, $totalCount);
|
||||
return $doSet;
|
||||
if(class_exists('PaginatedList')) {
|
||||
$list = new PaginatedList($doSet);
|
||||
$list->setPageStart($start);
|
||||
$list->setPageLEngth($pageLength);
|
||||
$list->setTotalItems($totalCount);
|
||||
return $list;
|
||||
} else {
|
||||
$doSet->setPageLimits($start, $pageLength, $totalCount);
|
||||
return $doSet;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user