本文整理汇总了PHP中DataQuery::disjunctiveGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP DataQuery::disjunctiveGroup方法的具体用法?PHP DataQuery::disjunctiveGroup怎么用?PHP DataQuery::disjunctiveGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataQuery
的用法示例。
在下文中一共展示了DataQuery::disjunctiveGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSubgroupHandoff
public function testSubgroupHandoff()
{
$dq = new DataQuery('DataQueryTest_A');
$subDq = $dq->disjunctiveGroup();
$orgDq = clone $dq;
$subDq->sort('"DataQueryTest_A"."Name"');
$orgDq->sort('"DataQueryTest_A"."Name"');
$this->assertEquals($dq->sql(), $orgDq->sql());
$subDq->limit(5, 7);
$orgDq->limit(5, 7);
$this->assertEquals($dq->sql(), $orgDq->sql());
}
示例2: apply
/**
* @param DataQuery $query
*
* @return $this|DataQuery
*/
public function apply(DataQuery $query)
{
$orGroup = $query->disjunctiveGroup();
$orGroup = parent::apply($orGroup);
if (count($this->subfilters) > 0) {
foreach ($this->subfilters as $f) {
$orGroup = $f->apply($orGroup);
}
}
// The original query will have been affected by the things added to $orGroup above
// but returning this instead of that will cause new filters to be added as AND
return $query;
}