Cumulative where clause

I think the where clause should be cumulative, i.e. the library could use an array internally ($_where = []) in the case we need to add a new where clause after another, say, according to a user permission or group. There are several other clauses that can stack…

$crud->where(['user_id' => $id]); 
if (auth()->user()->inGroup('admin')) {
    $crud->where(['user_group' => 'admin']); 
}

IMHO the mixed usage of Laminas\Db\Sql\Where in filtering and author’s own managed where clause should be normalized :grimacing:

Just to let everyone know that this is now possible with GCE >= v3.0.10. So we can use several where clauses one after another (like in the example above).
Thanks @johnny

1 Like