-# class pq\Gateway\Rowset implements SeekableIterator, JsonSerialize, Countable
+# class pq\Gateway\Rowset implements SeekableIterator, JsonSerializable, Countable
The rowset gateway.
--- /dev/null
+# void pq\Gateway\Rowset::__construct(pq\Gateway\Table $table[, pq\Result $result = NULL])
+
+Create a new rowset gateway.
+
+## Params:
+
+* pq\Gateway\Table $table
+ The originating table.
+* Optional pq\Result $result = NULL
+ A result to hydrate.
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::__invoke([pq\Result $result = NULL])
+
+Copy constructor.
+
+## Params:
+
+* Optional pq\Result $result = NULL
+ The result the clone should hydrate.
+
+## Returns:
+
+* pq\Gateway\Rowset, clone.
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::append(pq\Gateway\Row $row)
+
+Append a row to the rowset.
+
+## Params:
+
+* pq\Gateway\Row $row
+ The row to append.
+
+## Returns:
+
+* pq\Gateway\Rowset, self.
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::apply(callable $cb)
+
+Apply a callback to each row of this rowset.
+
+## Params:
+
+* callable $cb
+ A callback as function(pq\Gateway\Row $row, pq\Gateway\Rowset $rowset).
+
+## Returns:
+
+* pq\Gateway\Rowset, self.
+
+## Example:
+
+ <?php
+
+ use pq\Gateway\Table;
+
+ $table = new Table("account");
+ $table->find()->apply(function($row) {
+ printf("Hello %s!\n", $row->name);
+ });
+
+ ?>
+
--- /dev/null
+# int pq\Gateway\Rowset::count()
+
+Implements Countable.
+
+## Params:
+
+None.
+
+## Returns:
+
+* int, the number of rows in this rowset.
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::create([mixed $txn = TRUE])
+
+Create all rows in this rowset.
+
+## Params:
+
+* Optional mixed $txn = TRUE
+ Whether to perform the inserts within an transaction, could also be an instance of pq\Transaction to use.
+
+## Returns:
+
+* pq\Gateway\Rowset, self.
--- /dev/null
+# pq\Gateway\Row pq\Gateway\Rowset::current()
+
+Implements Iterator.
+
+## Params:
+
+None.
+
+## Returns:
+
+* pq\Gateway\Row, the current iterator element.
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::delete([mixed $txn = TRUE])
+
+Delete all rows in this rowset.
+
+## Params:
+
+* Optional mixed $txn = TRUE
+ Whether to perform the deletes within an transaction, could also be an instance of pq\Transaction to use.
+
+## Returns:
+
+* pq\Gateway\Rowset, self.
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::filter(callable $cb)
+
+Filter the rows a copy of the rowset should contain.
+
+## Params:
+
+* callable $cb
+ A filter callback which should return bool as function(pq\Gateway\Row $row)
+
+## Returns:
+
+* pq\Gateway\Rowset, clone.
+
+## Example:
+
+ <?php
+
+ use pq\Gateway\Table;
+
+ $table = new Table("account");
+ $table->find()
+ ->apply(function($row) {
+ // ...
+ })->filter(function ($row) {
+ return $row->isDirty();
+ })->update();
+
+ ?>
--- /dev/null
+# mixed pq\Gateway\Rowset::getRowPrototype()
+
+Retrieve the row prototype.
+See pq\Gatway\Rowset::setRowPrototype().
--- /dev/null
+# array pq\Gateway\Rowset::getRows()
+
+Retrieve the rows this rowset contains.
+
+## Params:
+
+None.
+
+## Returns:
+
+array, the rows of this rowset.
--- /dev/null
+# pq\Gateway\Table pq\Gateway\Rowset::getTable()
+
+Retrieve the table from which this rowset originates.
+
+## Params:
+
+None.
+
+## Returns:
+
+* pq\Gateway\Table, the originating table.
--- /dev/null
+# protected pq\Gateway\Rowset pq\Gateway\Rowset::hydrate([pq\Result $result = NULL])
+
+Hydrate a result.
+
+## Params:
+
+* Optional pq\Result $result = NULL
+ The result from which to extract the rows into the rowset.
+
+## Returns:
+
+* pq\Gateway\Rowset, self.
--- /dev/null
+# array pq\Gateway\Rowset::jsonSerialize()
+
+Implements JsonSerializable.
+
+## Params:
+
+None.
+
+## Returns:
+
+* array, list of rows, which have also been prepared for JSON serialization.
--- /dev/null
+# int pq\Gateway\Rowset::key()
+
+Implements Iterator.
+
+## Params:
+
+None.
+
+## Returns:
+
+* int, the iterator index.
--- /dev/null
+# void pq\Gateway\Rowset::next()
+
+Implements Iterator.
+
+## Params:
+
+None.
--- /dev/null
+# void pq\Gateway\Rowset::rewind()
+
+Implements Iterator.
+
+## Params:
+
+None.
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::seek(int $pos)
+
+Implements SeekableIterator.
+
+## Params:
+
+* int $pos
+ The position to seek to.
+
+## Returns:
+
+* pq\Gateway\Rowset, self.
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::setRowPrototype(mixed $row)
+
+Set the row prototype.
+
+## Params:
+
+* mixed $row
+ The name of a class extending pq\Gateway\Row or a callable as function(array $data).
+
+## Returns:
+
+* pq\Gateway\Rowset, self.
+
+## Example:
+
+ <?php
+
+ use pq\Gateway as gw;
+
+ class Account extends gw\Row {
+ // ...
+ }
+
+ $table = new gw\Table("account");
+ $table->setRowsetPrototype(
+ (new gw\Rowset($table))->setRowPrototype(new Account($table))
+ );
+
+ ?>
--- /dev/null
+# pq\Gateway\Rowset pq\Gateway\Rowset::update([mixed $txn = TRUE])
+
+Update all rows in this rowset.
+
+## Params:
+
+* Optional mixed $txn = TRUE
+ Whether to perform the updates within an transaction, could also be an instance of pq\Transaction to use.
+
+## Returns:
+
+* pq\Gateway\Rowset, self.
--- /dev/null
+# bool pq\Gateway\Rowset::valid()
+
+Implements Iterator.
+
+## Params:
+
+None.
+
+## Returns:
+
+* bool, whether the iterator's state is valid.