示例#1
0
 public function testToString()
 {
     $types = array('test' => MW_DB_Statement_Abstract::PARAM_STR, 'test()' => MW_DB_Statement_Abstract::PARAM_STR);
     $translations = array('test()' => 'testfunc($1,$2)');
     $object = new MW_Common_Criteria_Expression_Sort_SQL($this->_conn, '-', 'test');
     $this->assertEquals('test DESC', $object->toString($types));
     $object = new MW_Common_Criteria_Expression_Sort_SQL($this->_conn, '+', 'test(1,2.1)');
     $this->assertEquals('testfunc(1,2.1) ASC', $object->toString($types, $translations));
     $object = new MW_Common_Criteria_Expression_Sort_SQL($this->_conn, '-', 'test("a",2)');
     $this->assertEquals('testfunc(\'a\',2) DESC', $object->toString($types, $translations));
 }
示例#2
0
 /**
  * Returns the available compare, combine and sort operators.
  *
  * @return array Associative list of lists (compare, combine, sort) containing the available operators
  */
 public function getOperators()
 {
     return array('combine' => MW_Common_Criteria_Expression_Combine_SQL::getOperators(), 'compare' => MW_Common_Criteria_Expression_Compare_SQL::getOperators(), 'sort' => MW_Common_Criteria_Expression_Sort_SQL::getOperators());
 }