System:Model:addCalc

From Aspen Documentation

Items documented on this page are used in the demo aspen application, but may change in future revisions. Please consider these features experimental and watch the revision compatibility notes.

Adds a field calculation to db results. Currently, this function only supports totals. The calculations are performed on post-query results, which requires the iteration of the result set. Similar actions may typically be achieved in-query with SUM type selections.

Since 1.0

Arguments

void addCalc (string $field, [string $type = 'total'])

field
Database field present in result set.
type
Calculation type.

Returns

This function does not return any values.


Examples

Example:

$this->APP->model->addCalc('item_cost');