1 | <?php |
||
5 | class ArrayProcessor extends AbstractProcessor |
||
6 | { |
||
7 | /** |
||
8 | * Return comparable value from a row. |
||
9 | * |
||
10 | * @param mixed $row |
||
11 | * @param string $column |
||
12 | * @return int|string |
||
13 | */ |
||
14 | protected function field($row, $column) |
||
18 | |||
19 | /** |
||
20 | * Return the n-th element of collection. |
||
21 | * Must return null if not exists. |
||
22 | * |
||
23 | * @param array $rows |
||
24 | * @param int $offset |
||
25 | * @return mixed |
||
26 | */ |
||
27 | protected function offset($rows, $offset) |
||
31 | |||
32 | /** |
||
33 | * Slice rows, like PHP function array_slice(). |
||
34 | * |
||
35 | * @param array $rows |
||
36 | * @param int $offset |
||
37 | * @param null|int $length |
||
38 | * @return array |
||
39 | */ |
||
40 | protected function slice($rows, $offset, $length = null) |
||
44 | |||
45 | /** |
||
46 | * Count rows, like PHP function count(). |
||
47 | * |
||
48 | * @param array $rows |
||
49 | * @return int |
||
50 | */ |
||
51 | protected function count($rows) |
||
55 | |||
56 | /** |
||
57 | * Reverse rows, like PHP function array_reverse(). |
||
58 | * |
||
59 | * @param array $rows |
||
60 | * @return array |
||
61 | */ |
||
62 | protected function reverse($rows) |
||
66 | } |
||
67 |