Skip to content

Commit

Permalink
Make the filter function in Look optionnal closing #569 closes #569.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Aug 29, 2017
1 parent 189deb6 commit 3cb153c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion RedBeanPHP/Util/Look.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ public function look( $sql, $bindings = array(), $keys = array( 'selected', 'id'
foreach( $rows as $row ) {
$values = array();
foreach( $keys as $key ) {
$values[] = call_user_func_array( $filter, array( $row[$key] ) );
if (!empty($filter)) {
$values[] = call_user_func_array( $filter, array( $row[$key] ) );
} else {
$values[] = $row[$key];
}
}
$lines[] = vsprintf( $template, $values );
}
Expand Down

0 comments on commit 3cb153c

Please sign in to comment.