class GroupedSelection extends Selection

Representation of filtered table grouped by some column.

GroupedSelection is based on the great library NotORM http://www.notorm.com written by Jakub Vrana.

Properties

protected Selection $refTable
protected mixed $refCacheCurrent
protected string $column
protected int $active

Methods

__construct(Context $context, IConventions $conventions, $tableName, $column, Selection $refTable, IStorage $cacheStorage = null)

Creates filtered and grouped table representation.

setActive($active)

Sets active group.

select($columns, ...$params)

No description

order($columns, ...$params)

No description

int
aggregation($function)

Executes aggregation function.

int
count($column = null)

No description

execute()

No description

getRefTable($refPath)

No description

loadRefCache()

Loads refCache references

emptyResultSet($saveCache = true, $deleteRererencedCache = true)

No description

ActiveRow|int|bool
insert($data)

Inserts row in a table.

int
update($data)

Updates all rows in result set.

int
delete()

Deletes all rows in result set.

Details

at line 43
__construct(Context $context, IConventions $conventions, $tableName, $column, Selection $refTable, IStorage $cacheStorage = null)

Creates filtered and grouped table representation.

Parameters

Context $context
IConventions $conventions
$tableName
$column
Selection $refTable
IStorage $cacheStorage

at line 57
GroupedSelection setActive($active)

internal  
 

Sets active group.

Parameters

$active

Return Value

GroupedSelection

at line 67
Selection select($columns, ...$params)

No description

Parameters

$columns
...$params

Return Value

Selection

at line 80
Selection order($columns, ...$params)

No description

Parameters

$columns
...$params

Return Value

Selection

at line 94
int aggregation($function)

Executes aggregation function.

Parameters

$function

Return Value

int

at line 123
int count($column = null)

No description

Parameters

$column

Return Value

int

at line 133
protected execute()

No description

at line 188
protected Selection getRefTable($refPath)

No description

Parameters

$refPath

Return Value

Selection

at line 201
protected loadRefCache()

Loads refCache references

at line 217
protected emptyResultSet($saveCache = true, $deleteRererencedCache = true)

No description

Parameters

$saveCache
$deleteRererencedCache

at line 226
ActiveRow|int|bool insert($data)

Inserts row in a table.

Parameters

$data

Return Value

ActiveRow|int|bool

Returns IRow or number of affected rows for Selection or table without primary key

at line 244
int update($data)

Updates all rows in result set.

Joins in UPDATE are supported only in MySQL

Parameters

$data

Return Value

int

number of affected rows

at line 257
int delete()

Deletes all rows in result set.

Return Value

int

number of affected rows