expr() public method

Create a new Expr instance that can be used to build partial expressions for other operator methods.
public expr ( ) : Expr
return Expr $expr
 /**
  * @param Builder                $queryBuilder
  * @param ConditionNodeInterface $node
  * @param Expr                   $expr
  * @return null
  */
 protected function computeExpression(Builder $queryBuilder, ConditionNodeInterface $node, Expr $expr = null)
 {
     if (count($node->getFields()) == 0 && count($node->getChildren()) == 0) {
         return null;
     }
     $method = $node->getOperator() === ConditionNodeInterface::EXPR_AND ? 'addAnd' : 'addOr';
     $expression = null === $expr ? $queryBuilder : $expr;
     $count = 0;
     foreach ($node->getFields() as $condition) {
         if (null !== $condition) {
             /** @var ConditionInterface $condition */
             $expression->{$method}($condition->getExpression());
             $count++;
         }
     }
     foreach ($node->getChildren() as $child) {
         $subExpr = $queryBuilder->expr();
         $subCount = $this->computeExpression($queryBuilder, $child, $subExpr);
         if ($subCount > 0) {
             $expression->{$method}($subExpr);
             $count++;
         }
     }
     return $count;
 }
 /**
  * filter
  *
  * Filter the specification
  * 
  * @param  \Doctrine\MongoDB\Query\Builder $qb
  * @return \Doctrine\MongoDB\Query\Expr
  */
 public function filter(Query\Builder $qb)
 {
     $expr = $qb->expr();
     foreach ($this->specs as $spec) {
         if ($spec instanceof OdmSpecificationInterface) {
             $expr->addAnd($spec->filter($qb));
         }
     }
     return $expr;
 }
 /**
  * filter
  *
  * Apply the specification filter
  * 
  * @param  \Doctrine\MongoDB\Query\Builder $qb
  * @return \Doctrine\MongoDB\Query\Expr
  */
 public function filter(Query\Builder $qb)
 {
     return $qb->expr()->field($this->fieldName)->gt($this->fieldValue);
 }
 /**
  * filter
  *
  * Apply the query filter
  * 
  * @param  \Doctrine\MongoDB\Query\Builder $qb
  * @return \Doctrine\MongoDB\Query\Expr $expr
  */
 public function filter(Query\Builder $qb)
 {
     return $qb->expr()->sort($this->criteria);
 }
 /**
  * filter
  *
  * Apply the specification filter
  *
  * @param  \Doctrine\MongoDB\Query\Builder $qb
  * @return \Doctrine\MongoDB\Query\Expr
  */
 public function filter(Query\Builder $qb)
 {
     return $qb->expr()->field($this->fieldName)->includesReferenceTo($this->fieldValue);
 }