Permalink
Browse files

Make the filter function in Look optionnal closing #569 closes #569.

  • Loading branch information...
gabordemooij committed Aug 29, 2017
1 parent 189deb6 commit 3cb153c5d4f49fede3c8828a6710cf4e11633ca4
Showing with 5 additions and 1 deletion.
  1. +5 −1 RedBeanPHP/Util/Look.php
@@ -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 );
}

0 comments on commit 3cb153c

Please sign in to comment.