Example #1
0
 /**
  * Render a Condition object
  *
  * @param  SQL\Condition $condition
  * @return string
  */
 public static function render(SQL\Condition $condition)
 {
     $content = $condition->getContent();
     $parameters = $condition->getParameters();
     if ($parameters and is_string($content)) {
         $content = self::expandParameterArrays($content, $parameters);
     }
     return Compiler::expression(array(Compiler::name($condition->getColumn()), $content));
 }
Example #2
0
 /**
  * @covers ::__construct
  * @covers ::getColumn
  */
 public function testConstruct()
 {
     $condition = new SQL\Condition('test1', '!= ?');
     $this->assertEquals('test1', $condition->getColumn());
     $this->assertEquals('!= ?', $condition->getContent());
 }