diff --git a/src/Reports/PagesWithoutReviewScheduleReport.php b/src/Reports/PagesWithoutReviewScheduleReport.php index 0f7b402..fb3a0f2 100644 --- a/src/Reports/PagesWithoutReviewScheduleReport.php +++ b/src/Reports/PagesWithoutReviewScheduleReport.php @@ -107,7 +107,7 @@ public function columns() * * @return SS_List */ - public function sourceRecords($params = []) + public function sourceRecords($params = [], $sort = null, $limit = null) { Versioned::set_stage(Versioned::DRAFT); @@ -125,7 +125,13 @@ public function sourceRecords($params = []) )); } - $records->sort("ParentID"); + if ($sort !== null) { + $sort = 'ParentID'; + } + $records->sort($sort); + if ($limit !== null) { + $records = $records->limit($limit); + } $records = $records->toArray(); // Trim out calculated values