1 | <?php |
||
24 | class TabularCollection extends MultiCollection |
||
25 | { |
||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | 22 | protected function prepareData($data) |
|
33 | |||
34 | /** |
||
35 | * Magic method call. |
||
36 | * |
||
37 | * @param string $method The name of the method |
||
38 | * @param array $args The argument list |
||
39 | * |
||
40 | * @throws BadMethodCallException If no method exists |
||
41 | * |
||
42 | * @return mixed |
||
43 | * |
||
44 | * @todo Add phpdoc comments for dynamic methods |
||
45 | * @todo throw BadMethodCallException |
||
46 | */ |
||
47 | 8 | public function __call($method, $args) |
|
58 | |||
59 | /** |
||
60 | * Does this collection have specified column? |
||
61 | * |
||
62 | * @param mixed $column The column index |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | 8 | public function hasColumn($column) |
|
76 | |||
77 | /** |
||
78 | * Get column as collection. |
||
79 | * |
||
80 | * @param mixed $column The column index |
||
81 | * @param bool $throw Throw an exception on failure |
||
82 | * |
||
83 | * @return AbstractCollection|false |
||
84 | */ |
||
85 | 9 | public function getColumn($column, $throw = true) |
|
97 | |||
98 | /** |
||
99 | * Does this collection have a row at specified index? |
||
100 | * |
||
101 | * @param int $offset The column index |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | 1 | public function hasRow($offset) |
|
115 | |||
116 | /** |
||
117 | * Get row at specified index. |
||
118 | * |
||
119 | * @param int $offset The row offset (starts from 0) |
||
120 | * |
||
121 | * @return AbstractCollection|false |
||
122 | */ |
||
123 | 3 | public function getRow($offset) |
|
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | 1 | public function map(callable $callback) |
|
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | public function walk(callable $callback, $extraContext = null) |
||
152 | |||
153 | /** |
||
154 | * Is input data structure valid? |
||
155 | * |
||
156 | * In order to determine whether a given data structure is valid for a |
||
157 | * particular collection type (tabular, numeric, etc.), we have this method. |
||
158 | * |
||
159 | * @param mixed $data The data structure to check |
||
160 | * |
||
161 | * @return bool True if data structure is tabular |
||
162 | */ |
||
163 | 22 | protected function isConsistentDataStructure($data) |
|
167 | } |
||
168 |