8ede9ab8672c598eede2627f6db0c269263da32b
[mdref/mdref-pq-gateway] / pq-gateway / pq / Gateway / Rowset / apply.md
1 # pq\Gateway\Rowset pq\Gateway\Rowset::apply(callable $cb)
2
3 Apply a callback to each row of this rowset.
4
5 ## Params:
6
7 * callable $cb
8 A callback as function(pq\Gateway\Row $row, pq\Gateway\Rowset $rowset).
9
10 ## Returns:
11
12 * pq\Gateway\Rowset, self.
13
14 ## Example:
15
16 <?php
17
18 use pq\Gateway\Table;
19
20 $table = new Table("account");
21 $table->find()->apply(function($row) {
22 printf("Hello %s!\n", $row->name);
23 });
24
25 ?>
26