本文整理汇总了PHP中DboSource::order方法的典型用法代码示例。如果您正苦于以下问题:PHP DboSource::order方法的具体用法?PHP DboSource::order怎么用?PHP DboSource::order使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DboSource
的用法示例。
在下文中一共展示了DboSource::order方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testComplexSortExpression
/**
* testComplexSortExpression method
*
* @return void
*/
public function testComplexSortExpression()
{
$result = $this->Dbo->order(array('(Model.field > 100) DESC', 'Model.field ASC'));
$this->assertRegExp("/^\\s*ORDER BY\\s+\\(`Model`\\.`field`\\s+>\\s+100\\)\\s+DESC,\\s+`Model`\\.`field`\\s+ASC\\s*\$/", $result);
}
示例2: testOrderAdditionalParams
/**
* Tests additional order options for postgres
*
* @return void
*/
public function testOrderAdditionalParams()
{
$result = $this->Dbo->order(array('title' => 'DESC NULLS FIRST', 'body' => 'DESC'));
$expected = ' ORDER BY "title" DESC NULLS FIRST, "body" DESC';
$this->assertEquals($expected, $result);
}
示例3: testComplexSortExpression
/**
* testComplexSortExpression method
*
* @return void
*/
public function testComplexSortExpression() {
$result = $this->Dbo->order(array('(Model.field > 100) DESC', 'Model.field ASC'));
$this->assertPattern("/^\s*ORDER BY\s+\(`Model`\.`field`\s+>\s+100\)\s+DESC,\s+`Model`\.`field`\s+ASC\s*$/", $result);
}