Constants

ASSOC_ALL

ASSOC_ALL = -1

Properties

$groups

$groups : 

Type

$assocKeyFieldName

$assocKeyFieldName : 

Type

$assocValueFieldName

$assocValueFieldName : 

Type

Methods

__construct()

__construct(\Weby\Sloth\Sloth  $sloth,   $groupCols,   $valueCols) 

Parameters

\Weby\Sloth\Sloth $sloth
$groupCols
$valueCols

count()

count(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to calculate record count in a group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

sum()

sum(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to sum values for each value column in a group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

avg()

avg(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to caclulate average value for each value column in group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

accum()

accum(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to accumulate values for each value column in group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

first()

first(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to accumulate only a first value for each value column in group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

concat()

concat(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to concatinate values of the value columns for each group.

If a column list is specified in $cols parameter the function will be applied only to that column list. The column list should be a subset of the value columns.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

min()

min(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to caclulate min value for each value column in group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

max()

max(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to caclulate max value for each value column in group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

median()

median(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to caclulate median value for each value column in group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

mode()

mode(mixed  $cols = null) : \Weby\Sloth\Operation\Group

Whether to caclulate mode value for each value column in group.

Parameters

mixed $cols

Returns

\Weby\Sloth\Operation\Group

asAssoc()

asAssoc(mixed  $keyColumn = null,   $valueColumn = null) : \Weby\Sloth\Operation\Group

Whether to convert the output into the assoc array.

Keys of the assoc array will be values of $keyColumn. Values of the assoc array will be values of $valueColumn.

  • If $key is omitted then first group column will be used.
  • If $value is omitted then first non-group column will be used.
  • If $value is specified as '*' then value will be entire output row.

Parameters

mixed $keyColumn
$valueColumn

Returns

\Weby\Sloth\Operation\Group

validatePerform()

validatePerform() 

beginPerform()

beginPerform() 

doPerform()

doPerform() 

endPerform()

endPerform() 

mapColsToFunc()

mapColsToFunc(  $cols,   $func) 

Parameters

$cols
$func

hasCountAsterixFunc()

hasCountAsterixFunc() 

buildOutput()

buildOutput(  $row) 

Parameters

$row

getGroupKey()

getGroupKey(  $row) 

Parameters

$row

addGroup()

addGroup(  $key,   $row) 

Parameters

$key
$row

addGroup_processGroupCols()

addGroup_processGroupCols(  $group,   $row) 

Parameters

$group
$row

addGroup_processGroupFuncs()

addGroup_processGroupFuncs(  $group,   $row) 

Parameters

$group
$row

addGroup_processValueFuncs()

addGroup_processValueFuncs(  $group,   $row) 

Parameters

$group
$row

updateGroup()

updateGroup(  $key,   $row) 

Parameters

$key
$row

updateGroup_processGroupFuncs()

updateGroup_processGroupFuncs(  $group,   $row) 

Parameters

$group
$row

updateGroup_processValueFuncs()

updateGroup_processValueFuncs(  $group,   $row) 

Parameters

$group
$row

resetOutput()

resetOutput() 

resetStore()

resetStore() 

resetOutputCols()

resetOutputCols() 

resetGroups()

resetGroups() 

isGroup()

isGroup(  $key) 

Parameters

$key