| 1 | <?php |
||
| 5 | class Rows implements \IteratorAggregate, \Countable, \ArrayAccess |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var Row[] |
||
| 9 | */ |
||
| 10 | protected $rows = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @param array $rows |
||
| 14 | */ |
||
| 15 | public function __construct(array $rows = []) |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @see IteratorAggregate::getIterator() |
||
| 22 | */ |
||
| 23 | public function getIterator() |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Add row |
||
| 30 | * |
||
| 31 | * @param Row $row |
||
| 32 | * @return Rows |
||
| 33 | */ |
||
| 34 | public function addRow(Row $row) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @see Countable::count() |
||
| 43 | */ |
||
| 44 | public function count() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Returns the iterator as an array |
||
| 51 | * |
||
| 52 | * @return array |
||
| 53 | */ |
||
| 54 | public function toArray() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param int $offset |
||
| 61 | * @return bool |
||
| 62 | */ |
||
| 63 | public function offsetExists($offset) |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param int $offset |
||
| 70 | * @return Row|mixed|null |
||
| 71 | */ |
||
| 72 | public function offsetGet($offset) |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @param int $offset |
||
| 79 | * @param Row $value |
||
| 80 | */ |
||
| 81 | public function offsetSet($offset, $value) |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @param int $offset |
||
| 88 | */ |
||
| 89 | public function offsetUnset($offset) |
||
| 93 | } |
||
| 94 |