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 | $refTable | referenced table | |
| protected | $refCacheCurrent | current assigned referencing array | |
| protected | $column | grouping column name | |
| protected | $active | primary key | 
Methods
Creates filtered and grouped table representation.
Sets active group.
No description
Calculates aggregation for this group.
Counts number of rows. If column is not provided returns count of result rows, otherwise runs new sql counting query.
No description
Returns Selection parent for caching.
Loads refCache references
No description
Inserts row in a table. Returns ActiveRow or number of affected rows for Selection or table without primary key.
Updates all rows in result set.
Deletes all rows in result set.
Details
        at line 39
                            
    __construct(Explorer $explorer, string $tableName, string $column, Selection $refTable)
        
    
    Creates filtered and grouped table representation.
        at line 56
                            GroupedSelection
    setActive(int|string $active)
        
    
    | internal | 
Sets active group.
        at line 63
                            Selection
    select(string $columns, ...$params)
        
    
    No description
        at line 73
                            Selection
    order(string $columns, ...$params)
        
    
    No description
        at line 84
                            void
    refreshData()
        
    
    No description
        at line 97
                            mixed
    aggregation(string $function, string|null $groupFunction = null)
        
    
    Calculates aggregation for this group.
        at line 134
                            int
    count(string|null $column = null)
        
    
    Counts number of rows. If column is not provided returns count of result rows, otherwise runs new sql counting query.
        at line 143
                    protected        void
    execute()
        
    
    No description
        at line 203
                    protected        Selection
    getRefTable($refPath)
        
    
    Returns Selection parent for caching.
        at line 216
                    protected        void
    loadRefCache()
        
    
    Loads refCache references
        at line 231
                    protected        void
    emptyResultSet(bool $clearCache = true, bool $deleteReferencedCache = true)
        
    
    No description
        at line 240
                            ActiveRow|array|int|bool
    insert(iterable $data)
        
    
    Inserts row in a table. Returns ActiveRow or number of affected rows for Selection or table without primary key.
        at line 258
                            int
    update(iterable $data)
        
    
    Updates all rows in result set.
Joins in UPDATE are supported only in MySQL
        at line 271
                            int
    delete()
        
    
    Deletes all rows in result set.