Пример #1
0
 /**
  * Func::arguments test
  */
 public function testarguments()
 {
     $function = new Func('count', '*');
     $this->assertEquals(array('*'), $function->arguments());
     // multiple
     $function = new Func('max', 'foo', 'bar');
     $this->assertEquals(array('foo', 'bar'), $function->arguments());
 }
Пример #2
0
 /**
  * Escapes an sql function object
  * 
  * @param Func              $function
  * @return string
  */
 protected function escapeFunction($function)
 {
     $buffer = $function->name() . '(';
     $arguments = $function->arguments();
     foreach ($arguments as &$argument) {
         $argument = $this->escape($argument);
     }
     return $buffer . implode(', ', $arguments) . ')';
 }