Lines Matching refs:rows
124 $rows = [];
126 $rows[] = [
138 $rows = array_values(array_filter($rows, static function ($r) {
143 $rows = $this->applyFilters($rows, $filters);
144 $rows = $this->sortRows($rows, $sort, $order);
145 $total = count($rows);
147 [$pageRows, $page, $totalPages, $from, $to] = $this->paginate($rows, $perPage);
245 * @param array $rows
249 protected function applyFilters(array $rows, array $filters) argument
252 return $rows;
254 return array_values(array_filter($rows, function ($row) use ($filters) {
288 * @param array $rows
293 protected function sortRows(array $rows, $sort, $order) argument
295 usort($rows, static function ($a, $b) use ($sort) {
302 $rows = array_reverse($rows);
304 return $rows;
310 * @param array $rows all rows (already filtered + sorted)
315 protected function paginate(array $rows, $perPage) argument
318 $total = count($rows);
321 return [$rows, 1, 1, $total > 0 ? 1 : 0, $total];
334 $slice = array_slice($rows, $offset, $perPage);