public function ClosureExpressionVisitor::walkCompositeExpression in Plug 7
Converts a composite expression into the target query language output.
Parameters
CompositeExpression $expr:
Return value
mixed
Overrides ExpressionVisitor::walkCompositeExpression
File
- lib/
doctrine/ collections/ lib/ Doctrine/ Common/ Collections/ Expr/ ClosureExpressionVisitor.php, line 174
Class
- ClosureExpressionVisitor
- Walks an expression graph and turns it into a PHP closure.
Namespace
Doctrine\Common\Collections\ExprCode
public function walkCompositeExpression(CompositeExpression $expr) {
$expressionList = array();
foreach ($expr
->getExpressionList() as $child) {
$expressionList[] = $this
->dispatch($child);
}
switch ($expr
->getType()) {
case CompositeExpression::TYPE_AND:
return $this
->andExpressions($expressionList);
case CompositeExpression::TYPE_OR:
return $this
->orExpressions($expressionList);
default:
throw new \RuntimeException("Unknown composite " . $expr
->getType());
}
}