本文整理汇总了PHP中CRM_Report_Form::whereClause方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Report_Form::whereClause方法的具体用法?PHP CRM_Report_Form::whereClause怎么用?PHP CRM_Report_Form::whereClause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Report_Form
的用法示例。
在下文中一共展示了CRM_Report_Form::whereClause方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: whereClause
/**
* Generate where clause.
*
* We are overriding this primarily for 'before-after' handling of the receive_date placeholder field.
*
* We call this twice. The first time we are generating a temp table and we want to do an IS NULL on the
* join that draws in contributions from this year. The second time we are filtering elsewhere (contacts via
* the temp table & contributions via selective addition of contributions in the select function).
*
* If lifetime total is NOT selected we can add a further filter here to possibly improve performance
* but the benefit if unproven as yet.
* $clause = $this->whereClauseLastYear("{$this->_aliases['civicrm_contribution']}.receive_date");
*
* @param array $field Field specifications
* @param string $op Query operator (not an exact match to sql)
* @param mixed $value
* @param float $min
* @param float $max
*
* @return null|string
*/
public function whereClause(&$field, $op, $value, $min, $max)
{
if ($field['name'] == 'receive_date') {
$clause = 1;
if (empty($this->contactTempTable)) {
$this->_whereClauses[] = "cont_exclude.id IS NULL";
}
} else {
$clause = parent::whereClause($field, $op, $value, $min, $max);
}
return $clause;
}
示例2: whereClause
/**
* Generate where clause.
*
* We are overriding this primarily for 'before-after' handling of the receive_date placeholder field.
*
* We call this twice. The first time we are generating a temp table and we want to do an IS NULL on the
* join that draws in contributions from this year. The second time we are filtering elsewhere (contacts via
* the temp table & contributions via selective addition of contributions in the select function).
*
* If lifetime total is NOT selected we can add a further filter here to possibly improve performance
* but the benefit if unproven as yet.
* $clause = $this->whereClauseLastYear("{$this->_aliases['civicrm_contribution']}.receive_date");
*
* @param array $field Field specifications
* @param string $op Query operator (not an exact match to sql)
* @param mixed $value
* @param float $min
* @param float $max
*
* @return null|string
*/
public function whereClause(&$field, $op, $value, $min, $max)
{
if ($field['name'] == 'receive_date') {
$clause = 1;
if (empty($this->contactTempTable)) {
$this->_whereClauses[] = "cont_exclude.id IS NULL";
}
} else {
$clause = parent::whereClause($field, $op, $value, $min, $max);
}
if ($field['name'] == 'contribution_status_id' || $field['name'] == 'financial_type_id') {
$this->_statusClause .= " AND " . $clause;
}
return $clause;
}