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, $groupFunction = null)

No description

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 97
int aggregation($function, $groupFunction = null)

No description

Parameters

$function
$groupFunction

Return Value

int

at line 135
int count($column = null)

No description

Parameters

$column

Return Value

int

at line 145
protected execute()

No description

at line 200
protected Selection getRefTable($refPath)

No description

Parameters

$refPath

Return Value

Selection

at line 213
protected loadRefCache()

Loads refCache references

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

No description

Parameters

$saveCache
$deleteRererencedCache

at line 238
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 256
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 269
int delete()

Deletes all rows in result set.

Return Value

int

number of affected rows