当前位置: 首页>>代码示例>>PHP>>正文


PHP JDatabaseQuery::extendWhere方法代码示例

本文整理汇总了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.');
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:18,代码来源:JDatabaseQueryTest.php


注:本文中的JDatabaseQuery::extendWhere方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。