Rowset
[mdref/mdref-pq-gateway] / pq-gateway / pq / Gateway / Rowset / filter.md
1 # pq\Gateway\Rowset pq\Gateway\Rowset::filter(callable $cb)
2
3 Filter the rows a copy of the rowset should contain.
4
5 ## Params:
6
7 * callable $cb
8 A filter callback which should return bool as function(pq\Gateway\Row $row)
9
10 ## Returns:
11
12 * pq\Gateway\Rowset, clone.
13
14 ## Example:
15
16 <?php
17
18 use pq\Gateway\Table;
19
20 $table = new Table("account");
21 $table->find()
22 ->apply(function($row) {
23 // ...
24 })->filter(function ($row) {
25 return $row->isDirty();
26 })->update();
27
28 ?>