Skip to content

Commit

Permalink
pkp/pkp-lib#10511 adjusts the retrieval of an array of series, using …
Browse files Browse the repository at this point in the history
…map with keys.

Co-authored-by: Jonas Raoni Soares da Silva <[email protected]>
  • Loading branch information
YvesLepidus and jonasraoni authored Nov 18, 2024
1 parent 8015a2f commit e765990
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ public function fetch($request, $template = null, $display = false)
->getCollector()
->filterByContextIds([$contextId])
->getMany();

$seriesTitles = [];
foreach ($series as $seriesObj) {
$seriesTitles[$seriesObj->getId()] = $seriesObj->getLocalizedTitle();
}
$seriesTitles = $series->mapWithKeys(fn (Section $seriesObj) => [
$seriesObj->getId() => $seriesObj->getLocalizedTitle()
])->all();

$categories = Repo::category()->getCollector()
->filterByParentIds([null])
Expand Down

0 comments on commit e765990

Please sign in to comment.