GroupedSelection
class GroupedSelection extends Selection
Represents filtered table grouped by referencing table.
GroupedSelection is based on the great library NotORM http://www.notorm.com written by Jakub Vrana.
Properties
| protected | $refCacheCurrent | current assigned referencing array |
|
| protected | $active | primary key |
Methods
Creates filtered and grouped table representation.
Sets active group.
Adds a SELECT clause. Automatically prepends the grouping column if no select exists yet.
Adds an ORDER BY clause. Automatically prepends the grouping column (matching direction) to improve index utilization.
Invalidates cached data and forces reload on next access.
Calculates aggregation for this group.
Returns count of fetched rows, or runs COUNT($column) query when column is specified.
No description
No description
Initializes the reference cache for the current selection. Overridden by GroupedSelection.
No description
No description
Updates all rows matching current conditions. JOINs in UPDATE are supported only by MySQL.
Deletes all rows matching current conditions.
Details
at line 34
__construct(Explorer $explorer, string $tableName, string $column, Selection $refTable)
Creates filtered and grouped table representation.
at line 51
GroupedSelection
setActive(int|string $active)
| internal |
Sets active group.
at line 61
Selection
select(string $columns, mixed ...$params)
Adds a SELECT clause. Automatically prepends the grouping column if no select exists yet.
at line 74
Selection
order(string $columns, mixed ...$params)
Adds an ORDER BY clause. Automatically prepends the grouping column (matching direction) to improve index utilization.
at line 88
void
refreshData()
Invalidates cached data and forces reload on next access.
at line 101
mixed
aggregation(string $function, string|null $groupFunction = null)
Calculates aggregation for this group.
at line 140
int
count(string|null $column = null)
Returns count of fetched rows, or runs COUNT($column) query when column is specified.
at line 149
protected void
execute()
No description
at line 215
protected Selection
getRefTable(mixed $refPath)
No description
at line 228
protected void
loadRefCache()
Initializes the reference cache for the current selection. Overridden by GroupedSelection.
at line 243
protected void
emptyResultSet(bool $clearCache = true, bool $deleteReferencedCache = true)
No description
at line 255
ActiveRow|array|int
insert(iterable $data)
No description
at line 274
int
update(iterable $data)
Updates all rows matching current conditions. JOINs in UPDATE are supported only by MySQL.
at line 287
int
delete()
Deletes all rows matching current conditions.