本文整理汇总了PHP中JDatabaseQuery::extendWhere方法的典型用法代码示例。如果您正苦于以下问题:PHP JDatabaseQuery::extendWhere方法的具体用法?PHP JDatabaseQuery::extendWhere怎么用?PHP JDatabaseQuery::extendWhere使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JDatabaseQuery
的用法示例。
在下文中一共展示了JDatabaseQuery::extendWhere方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testExtendWhere
/**
* Tests the JDatabaseQuery::extendWhere method.
*
* @return void
*
* @since 3.6
*/
public function testExtendWhere()
{
$this->assertThat($this->_instance->where('foo = 1')->extendWhere('ABC', 'bar = 2'), $this->identicalTo($this->_instance), 'Tests chaining.');
$this->assertThat(trim(TestReflection::getValue($this->_instance, 'where')), $this->equalTo('WHERE ' . PHP_EOL . '(foo = 1) ABC ' . PHP_EOL . '(bar = 2)'), 'Tests rendered value.');
// Add another set of where conditions.
$this->_instance->extendWhere('XYZ', array('baz = 3', 'goo = 4'));
$this->assertThat(trim(TestReflection::getValue($this->_instance, 'where')), $this->equalTo('WHERE ' . PHP_EOL . '(' . PHP_EOL . '(foo = 1) ABC ' . PHP_EOL . '(bar = 2)) XYZ ' . PHP_EOL . '(baz = 3 AND goo = 4)'), 'Tests rendered value after second use and array input.');
// Add another set of where conditions with some different glue.
$this->_instance->extendWhere('STU', array('faz = 5', 'gaz = 6'), 'VWX');
$this->assertThat(trim(TestReflection::getValue($this->_instance, 'where')), $this->equalTo('WHERE ' . PHP_EOL . '(' . PHP_EOL . '(' . PHP_EOL . '(foo = 1) ABC ' . PHP_EOL . '(bar = 2)) XYZ ' . PHP_EOL . '(baz = 3 AND goo = 4)) STU ' . PHP_EOL . '(faz = 5 VWX gaz = 6)'), 'Tests rendered value after third use, array input and different glue.');
}