本文整理匯總了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;
}