/**
* Setter for $_force.
*
- * @param $isForce
+ * @param bool $isForce
*/
public function setForce($isForce) {
$this->_force = $isForce;
}
/**
- * A form rule function to ensure that fields selected in group_by
- * (if any) should only be the ones present in display/select fields criteria;
+ * A form rule function for custom data.
+ *
+ * The rule ensures that fields selected in group_by if any) should only be the ones
+ * present in display/select fields criteria;
* note: works if and only if any custom field selected in group_by.
*
* @param array $fields
* Get SQL where clause for a date field.
*
* @param string $fieldName
- * @param $relative
+ * @param string $relative
* @param string $from
* @param string $to
* @param string $type
}
/**
- * @param $value
- * @param $customField
- * @param $fieldValueMap
+ * Format custom values.
+ *
+ * @param mixed $value
+ * @param array $customField
+ * @param array $fieldValueMap
*
* @return float|string|void
*/
}
/**
- * @param $rows
+ * Remove duplicate rows.
+ *
+ * @param array $rows
*/
public function removeDuplicates(&$rows) {
if (empty($this->_noRepeats)) {
}
/**
- * @param $row
- * @param $fields
+ * Fix subtotal display.
+ *
+ * @param array $row
+ * @param array $fields
* @param bool $subtotal
*/
public function fixSubTotalDisplay(&$row, $fields, $subtotal = TRUE) {
}
/**
- * @param $rows
+ * Calculate grant total.
+ *
+ * @param array $rows
*
* @return bool
*/
}
/**
- * @param $rows
+ * Format display output.
+ *
+ * @param array $rows
* @param bool $pager
*/
public function formatDisplay(&$rows, $pager = TRUE) {
}
/**
- * @param $rows
+ * Build chart.
+ *
+ * @param array $rows
*/
public function buildChart(&$rows) {
// override this method for building charts.
// towards generalizing the select() method below.
/**
- * Generate the SELECT clause and set class variable $_select
+ * Generate the SELECT clause and set class variable $_select.
*/
public function select() {
$select = $this->_selectAliases = array();
) {
// 1. In many cases we want select clause to be built in slightly different way
- // for a particular field of a particular type.
+ // for a particular field of a particular type.
// 2. This method when used should receive params by reference and modify $this->_columnHeaders
- // as needed.
+ // as needed.
$selectClause = $this->selectClause($tableName, 'fields', $fieldName, $field);
if ($selectClause) {
$select[] = $selectClause;
$this->_phoneField = TRUE;
}
// 1. In many cases we want select clause to be built in slightly different way
- // for a particular field of a particular type.
+ // for a particular field of a particular type.
// 2. This method when used should receive params by reference and modify $this->_columnHeaders
- // as needed.
+ // as needed.
$selectClause = $this->selectClause($tableName, 'group_bys', $fieldName, $field);
if ($selectClause) {
$select[] = $selectClause;
}
/**
+ * Build select clause for a single field.
+ *
* @param string $tableName
- * @param $tableKey
+ * @param string $tableKey
* @param string $fieldName
- * @param $field
+ * @param string $field
*
* @return bool
*/
return FALSE;
}
+ /**
+ * Build where clause.
+ */
public function where() {
$this->storeWhereHavingClauseArray();
}
/**
- * Store Where clauses into an array - breaking out this step makes
- * over-riding more flexible as the clauses can be used in constructing a
+ * Store Where clauses into an array.
+ *
+ * Breaking out this step makes over-riding more flexible as the clauses can be used in constructing a
* temp table that may not be part of the final where clause or added
* in other functions
*/
}
+ /**
+ * Set output mode.
+ */
public function processReportMode() {
$buttonName = $this->controller->getButtonName();
}
/**
- * Post Processing function for Form (postProcessCommon should be used to set other variables from input as the api accesses that function)
+ * Post Processing function for Form.
+ *
+ * postProcessCommon should be used to set other variables from input as the api accesses that function.
*/
public function beginPostProcess() {
$this->setParams($this->controller->exportValues($this->_name));
}
/**
- * BeginPostProcess function run in both report mode and non-report mode (api)
+ * BeginPostProcess function run in both report mode and non-report mode (api).
*/
- public function beginPostProcessCommon() {
-
- }
+ public function beginPostProcessCommon() {}
/**
+ * Build the report query.
+ *
* @param bool $applyLimit
*
* @return string
return $sql;
}
+ /**
+ * Build group by clause.
+ */
public function groupBy() {
$groupBys = array();
if (!empty($this->_params['group_bys']) &&
}
}
+ /**
+ * Build order by clause.
+ */
public function orderBy() {
$this->_orderBy = "";
$this->_sections = array();
}
/**
+ * Extract order by fields and store as an array.
+ *
* In some cases other functions want to know which fields are selected for ordering by
* Separating this into a separate function allows it to be called separately from constructing
* the order by clause
}
/**
+ * Determine unselected columns.
+ *
* @return array
*/
public function unselectedSectionColumns() {
}
/**
- * @param $sql
- * @param $rows
+ * Build output rows.
+ *
+ * @param string $sql
+ * @param array $rows
*/
public function buildRows($sql, &$rows) {
$dao = CRM_Core_DAO::executeQuery($sql);
}
/**
+ * Calculate section totals.
+ *
* When "order by" fields are marked as sections, this assigns to the template
* an array of total counts for each section. This data is used by the Smarty
- * plugin {sectionTotal}
+ * plugin {sectionTotal}.
*/
public function sectionTotals() {
}
}
+ /**
+ * Modify column headers.
+ */
public function modifyColumnHeaders() {
// use this method to modify $this->_columnHeaders
}
/**
- * @param $rows
+ * Assign rows to the template.
+ *
+ * @param array $rows
*/
public function doTemplateAssignment(&$rows) {
$this->assign_by_ref('columnHeaders', $this->_columnHeaders);
}
/**
- * override this method to build your own statistics
- * @param $rows
+ * Build report statistics.
+ *
+ * Override this method to build your own statistics.
+ *
+ * @param array $rows
*
* @return array
*/
}
/**
- * @param $statistics
- * @param $count
+ * Add count statistics.
+ *
+ * @param array $statistics
+ * @param int $count
*/
public function countStat(&$statistics, $count) {
$statistics['counts']['rowCount'] = array(
}
/**
- * @param $statistics
+ * Add group by statistics.
+ *
+ * @param array $statistics
*/
public function groupByStat(&$statistics) {
if (!empty($this->_params['group_bys']) &&
}
/**
- * @param $statistics
+ * Filter statistics.
+ *
+ * @param array $statistics
*/
public function filterStat(&$statistics) {
foreach ($this->_columns as $tableName => $table) {
/**
* Compile the report content.
+ *
* Although this function is super-short it is useful to keep separate so it can be over-ridden by report classes.
*
* @return string
}
+ /**
+ * Post process function.
+ */
public function postProcess() {
// get ready with post process params
$this->beginPostProcess();
}
/**
+ * Set limit.
+ *
* @param int $rowCount
+ *
* @return array
*/
public function limit($rowCount = self::ROW_COUNT_LIMIT) {
}
/**
+ * Set pager.
+ *
* @param int $rowCount
*/
public function setPager($rowCount = self::ROW_COUNT_LIMIT) {
}
/**
- * @param $field
- * @param $value
- * @param $op
+ * Build where clause for groups.
+ *
+ * @param string $field
+ * @param mixed $value
+ * @param string $op
*
* @return string
*/
}
/**
- * @param $field
- * @param $value
- * @param $op
+ * Build where clause for tags.
+ *
+ * @param string $field
+ * @param mixed $value
+ * @param string $op
*
* @return string
*/
/**
* Generate Membership Type SQL Clause.
+ *
* @param mixed $value
* @param string $op
*
}
/**
+ * Build acl clauses.
+ *
* @param string $tableAlias
*/
public function buildACLClause($tableAlias = 'contact_a') {
}
/**
+ * Add custom data to the columns.
+ *
* @param bool $addFields
* @param array $permCustomGroupIds
*/
}
}
+ /**
+ * Build custom data from clause.
+ */
public function customDataFrom() {
if (empty($this->_customGroupExtends)) {
return;
}
/**
- * @param $prop
+ * Check if the field is selected.
+ *
+ * @param string $prop
*
* @return bool
*/
}
/**
- * Does table name have columns in SELECT clause?
+ * Check if table name has columns in SELECT clause.
*
* @param string $tableName
* Name of table (index of $this->_columns array).
/**
* Fetch array of DAO tables having columns included in SELECT or ORDER BY clause.
- * (building the array if it's unset)
+ *
+ * If the array is unset it will be built.
*
* @return array
* selectedTables
}
/**
+ * Add address fields.
+ *
* @deprecated - use getAddressColumns which is a more accurate description
* and also accepts an array of options rather than a long list
*
/**
* Do AlterDisplay processing on Address Fields.
*
- * @param $row
- * @param $rows
- * @param $rowNum
- * @param $baseUrl
- * @param $urltxt
+ * @param array $row
+ * @param array $rows
+ * @param int $rowNum
+ * @param string $baseUrl
+ * @param string $urltxt
*
* @return bool
*/
}
/**
+ * Add contact to group.
+ *
* @param int $groupID
*/
public function add2group($groupID) {
}
/**
- * function used for showing charts on print screen.
+ * Show charts on print screen.
*/
public static function uploadChartImage() {
// upload strictly for '.png' images