1 | <?php |
||
19 | class TabularCollection extends MultiCollection |
||
20 | { |
||
21 | /** |
||
22 | * Magic method call. |
||
23 | * |
||
24 | * @param string $method The name of the method |
||
25 | * @param array $args The argument list |
||
26 | * |
||
27 | * @throws BadMethodCallException If no method exists |
||
28 | * |
||
29 | * @return mixed |
||
30 | * |
||
31 | * @todo Add phpdoc comments for dynamic methods |
||
32 | * @todo throw BadMethodCallException |
||
33 | */ |
||
34 | 8 | public function __call($method, $args) |
|
45 | |||
46 | /** |
||
47 | * Does this collection have specified column? |
||
48 | * |
||
49 | * @param mixed $column The column index |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | 8 | public function hasColumn($column) |
|
63 | |||
64 | /** |
||
65 | * Get column as collection. |
||
66 | * |
||
67 | * @param mixed $column The column index |
||
68 | * @param bool $throw Throw an exception on failure |
||
69 | * |
||
70 | * @return AbstractCollection|false |
||
71 | */ |
||
72 | 9 | public function getColumn($column, $throw = true) |
|
84 | |||
85 | /** |
||
86 | * Does this collection have a row at specified index? |
||
87 | * |
||
88 | * @param int $offset The column index |
||
89 | * |
||
90 | * @return bool |
||
91 | */ |
||
92 | 1 | public function hasRow($offset) |
|
102 | |||
103 | /** |
||
104 | * Get row at specified index. |
||
105 | * |
||
106 | * @param int $offset The row offset (starts from 0) |
||
107 | * |
||
108 | * @return AbstractCollection|false |
||
109 | */ |
||
110 | 3 | public function getRow($offset) |
|
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | 1 | public function map(callable $callback) |
|
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | 21 | public function walk(callable $callback, $extraContext = null) |
|
139 | |||
140 | /** |
||
141 | * Is input data structure valid? |
||
142 | * |
||
143 | * In order to determine whether a given data structure is valid for a |
||
144 | * particular collection type (tabular, numeric, etc.), we have this method. |
||
145 | * |
||
146 | * @param mixed $data The data structure to check |
||
147 | * |
||
148 | * @return bool True if data structure is tabular |
||
149 | */ |
||
150 | 43 | protected function isConsistentDataStructure($data) |
|
154 | } |
||
155 |