Skip to content

Commit

Permalink
Allow to use closure in QueryExpression
Browse files Browse the repository at this point in the history
Allow to use closure in QueryExpression. Fixes #3852
  • Loading branch information
MichalWadowski committed Jul 1, 2014
1 parent 0a566bd commit 184bbd4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Database/Expression/QueryExpression.php
Expand Up @@ -434,6 +434,11 @@ protected function _addConditions(array $conditions, array $types) {
if ($numericKey && empty($c)) {
continue;
}

if (is_callable($c)) {
$expr = new QueryExpression([], $typeMap);
$c = $c($expr, $this);
}

if ($numericKey && is_string($c)) {
$this->_conditions[] = $c;
Expand Down

0 comments on commit 184bbd4

Please sign in to comment.