Framework
3.9
|
Run a pivot query and return the results indexed by a selected field. More...
Public Member Functions | |
__construct ($base, $baseConstraint="", $indexBy="") | |
indexBy ($indexBy) | |
Sets the field by which the results should be indexed. More... | |
execute () | |
Public Member Functions inherited from AbstractPivotQuery | |
__construct ($base, $baseConstraint="") | |
Constructs a new AbstractPivotQuery. More... | |
pivot ($pivotClass, $pivotConstraint, $pivotFunction="SUM") | |
Adds the pivot to the query. More... | |
range ($rangeClass, $rangeConstraint) | |
Adds the range to the query. More... | |
field ($field, $alias="", $type=String) | |
Adds a fixed field to the output object. More... | |
pivotField ($format, $value, $alias=null, $expression="SUM", $type=Number) | |
Adds a pivot field format to the output object. More... | |
createPivotItem () | |
Creates an empty PivotItem, configured with fields and field aliases based on the pivot and range. More... | |
additionalFields () | |
Register additional fields from the base to be included in the PivotItem output. More... | |
Public Member Functions inherited from AbstractQuery | |
constraints ($constraints) | |
Sets the constraint clause for the Query. More... | |
filter ($filter) | |
Sets a filter to constrain the fields retrieved when the query is executed. More... | |
params ($params) | |
Sets the bound parameters array. More... | |
bind () | |
Binds placeholders to parameter values. More... | |
Static Public Member Functions | |
static | create ($base, $baseConstraint="", $indexBy="") |
Creates a new IndexedPivotQuery instance. More... | |
Public Attributes | |
$indexBy | |
Public Attributes inherited from AbstractPivotQuery | |
$baseClass | |
$baseConstraint | |
$baseItem | |
$rangeClass | |
$rangeConstraint | |
$pivotClass | |
$pivotConstraint | |
$pivotItem | |
$fields | |
$fieldAliases | |
$additionalFields = array() | |
$groupByFields = array() | |
$orderBy | |
$totalField = null | |
Public Attributes inherited from AbstractQuery | |
$class | |
$constraints | |
$filter | |
$params | |
Additional Inherited Members | |
Protected Member Functions inherited from AbstractPivotQuery | |
generateFieldExpressions () | |
Builds the expressions for the pivot query. More... | |
generateQuery () | |
Generates SQL for the full pivot query, with grouping. More... | |
Run a pivot query and return the results indexed by a selected field.
IndexedPivotQuery::__construct | ( | $base, | |
$baseConstraint = "" , |
|||
$indexBy = "" |
|||
) |
Definition at line 398 of file pivot.inc.
|
static |
Creates a new IndexedPivotQuery instance.
string | $base | class name for the base objects |
string | $baseConstraint | query constraint for the base objects |
string | $indexBy | the field by which the results should be indexed. |
Definition at line 473 of file pivot.inc.
IndexedPivotQuery::execute | ( | ) |
Reimplemented from AbstractQuery.
Definition at line 418 of file pivot.inc.
IndexedPivotQuery::indexBy | ( | $indexBy | ) |
Sets the field by which the results should be indexed.
string | $indexBy | the field by which the results should be indexed. |