ASSOC_ALL
ASSOC_ALL = -1
Group (group by) operation.
__construct(\Weby\Sloth\Sloth $sloth, $groupCols, $valueCols)
| \Weby\Sloth\Sloth | $sloth | |
| $groupCols | ||
| $valueCols |
count(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to calculate record count in a group.
| mixed | $cols |
sum(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to sum values for each value column in a group.
| mixed | $cols |
avg(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to caclulate average value for each value column in group.
| mixed | $cols |
accum(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to accumulate values for each value column in group.
| mixed | $cols |
first(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to accumulate only a first value for each value column in group.
| mixed | $cols |
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.
| mixed | $cols |
min(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to caclulate min value for each value column in group.
| mixed | $cols |
max(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to caclulate max value for each value column in group.
| mixed | $cols |
median(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to caclulate median value for each value column in group.
| mixed | $cols |
mode(mixed $cols = null) : \Weby\Sloth\Operation\Group
Whether to caclulate mode value for each value column in group.
| mixed | $cols |
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.
| mixed | $keyColumn | |
| $valueColumn |