public function compile(Expression $expression, DoctrineQueryBuilderParametersBinder $binder)
 {
     $result = '';
     if ($expression->getFunction()) {
         $compiledArgs = array();
         foreach ($expression->getFunctionArgs() as $arg) {
             if ($arg instanceof Expression) {
                 $compiledArgs[] = $this->compile($arg, $binder);
             } else {
                 $compiledArgs[] = $this->resolveArgument($arg, $binder);
             }
         }
         $result = $expression->getFunction() . '(' . implode(', ', $compiledArgs) . ')';
     } else {
         $result = $this->resolveArgument($expression->getExpression(), $binder);
     }
     if ($expression->getAlias()) {
         $result .= ' AS ' . $expression->getAlias();
     }
     return $result;
 }
 public function testSanitizeAlias()
 {
     $expr = new Expression('foo', '; DELETE FROM xxx', 'fullname');
     $this->assertFalse($expr->getAlias());
 }