You are here

private function ClosureExpressionVisitor::andExpressions in Plug 7

Parameters

array $expressions:

Return value

callable

1 call to ClosureExpressionVisitor::andExpressions()
ClosureExpressionVisitor::walkCompositeExpression in lib/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php
Converts a composite expression into the target query language output.

File

lib/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php, line 199

Class

ClosureExpressionVisitor
Walks an expression graph and turns it into a PHP closure.

Namespace

Doctrine\Common\Collections\Expr

Code

private function andExpressions($expressions) {
  return function ($object) use ($expressions) {
    foreach ($expressions as $expression) {
      if (!$expression($object)) {
        return false;
      }
    }
    return true;
  };
}