Skip to content

Commit dd3f8c6

Browse files
authored
Make it easier to override sort order in scheduled search notify command. (vufind-org#4247)
1 parent 5249ea8 commit dd3f8c6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ class NotifyCommand extends Command implements TranslatorAwareInterface
9898
*/
9999
protected $limit = 50;
100100

101+
/**
102+
* Sort order to use when performing searches
103+
*
104+
* @var string
105+
*/
106+
protected $sort = 'first_indexed desc';
107+
101108
/**
102109
* Constructor
103110
*
@@ -311,7 +318,7 @@ protected function getNewRecords($searchObject, $lastTime)
311318
// Prepare query
312319
$params = $searchObject->getParams();
313320
$params->setLimit($this->limit);
314-
$params->setSort('first_indexed desc', true);
321+
$params->setSort($this->sort, true);
315322
$searchId = $searchObject->getSearchId();
316323
try {
317324
$records = $searchObject->getResults();

0 commit comments

Comments
 (0)