You are here

public function ExpressionVisitor::dispatch in Plug 7

Dispatches walking an expression to the appropriate handler.

Parameters

Expression $expr:

Return value

mixed

Throws

\RuntimeException

1 call to ExpressionVisitor::dispatch()
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/ExpressionVisitor.php, line 66

Class

ExpressionVisitor
An Expression visitor walks a graph of expressions and turns them into a query for the underlying implementation.

Namespace

Doctrine\Common\Collections\Expr

Code

public function dispatch(Expression $expr) {
  switch (true) {
    case $expr instanceof Comparison:
      return $this
        ->walkComparison($expr);
    case $expr instanceof Value:
      return $this
        ->walkValue($expr);
    case $expr instanceof CompositeExpression:
      return $this
        ->walkCompositeExpression($expr);
    default:
      throw new \RuntimeException("Unknown Expression " . get_class($expr));
  }
}