Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • ActiveRow
  • GroupedSelection
  • Selection
  • SqlBuilder

Interfaces

  • IRow
  • IRowContainer
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases

Class GroupedSelection

Representation of filtered table grouped by some column. GroupedSelection is based on the great library NotORM http://www.notorm.com written by Jakub Vrana.

Nette\Database\Table\Selection implements Iterator, Nette\Database\Table\IRowContainer, ArrayAccess, Countable uses Nette\SmartObject
Extended by Nette\Database\Table\GroupedSelection
Namespace: Nette\Database\Table
Located at Database/Table/GroupedSelection.php
Methods summary
public
# __construct( Nette\Database\Context $context, Nette\Database\IConventions $conventions, string $tableName, string $column, Nette\Database\Table\Selection $refTable, Nette\Caching\IStorage $cacheStorage = null )

Creates filtered and grouped table representation.

Creates filtered and grouped table representation.

Parameters

$context
$conventions
$tableName
table name
$column
column
$refTable
$cacheStorage

Overrides

Nette\Database\Table\Selection::__construct()
public Nette\Database\Table\GroupedSelection
# setActive( integer $active )

Sets active group.

Sets active group.

Parameters

$active
key of grouped rows

Returns

Nette\Database\Table\GroupedSelection
static

Internal

public Nette\Database\Table\GroupedSelection
# select( string|string[] $columns, ... $params )

Parameters

$columns
example "column, MD5(column) AS column_md5"
$params

Returns

Nette\Database\Table\GroupedSelection
static

Overrides

Nette\Database\Table\Selection::select()
public Nette\Database\Table\GroupedSelection
# order( string $columns, ... $params )

Parameters

$columns
example 'column1, column2 DESC'
$params

Returns

Nette\Database\Table\GroupedSelection
static

Overrides

Nette\Database\Table\Selection::order()
public integer
# aggregation( string $function )

Executes aggregation function.

Executes aggregation function.

Parameters

$function
call in "FUNCTION(column)" format

Returns

integer
int

Overrides

Nette\Database\Table\Selection::aggregation()
public integer
# count( string $column = null )

Parameters

$column
it is not provided returns count of result rows, otherwise runs new sql counting query

Returns

integer
int

Overrides

Nette\Database\Table\Selection::count()
protected
# execute( )

Overrides

Nette\Database\Table\Selection::execute()
protected Nette\Database\Table\Selection
# getRefTable( & $refPath )

Returns

Nette\Database\Table\Selection
Selection

Overrides

Nette\Database\Table\Selection::getRefTable()
protected
# loadRefCache( )

Loads refCache references

Loads refCache references

Overrides

Nette\Database\Table\Selection::loadRefCache()
protected
# emptyResultSet( $saveCache = true, $deleteRererencedCache = true )

Overrides

Nette\Database\Table\Selection::emptyResultSet()
public Nette\Database\Table\ActiveRow|integer|boolean
# insert( array|Traversable|Nette\Database\Table\Selection $data )

Inserts row in a table.

Inserts row in a table.

Parameters

$data
$column => $value)|\Traversable|Selection for INSERT ... SELECT

Returns

Nette\Database\Table\ActiveRow|integer|boolean
Returns IRow or number of affected rows for Selection or table without primary key

Overrides

Nette\Database\Table\Selection::insert()
public integer
# update( iterable $data )

Updates all rows in result set. Joins in UPDATE are supported only in MySQL

Updates all rows in result set. Joins in UPDATE are supported only in MySQL

Parameters

$data
$column => $value)

Returns

integer
number of affected rows

Overrides

Nette\Database\Table\Selection::update()
public integer
# delete( )

Deletes all rows in result set.

Deletes all rows in result set.

Returns

integer
number of affected rows

Overrides

Nette\Database\Table\Selection::delete()
Methods inherited from Nette\Database\Table\Selection
__clone(), __destruct(), accessColumn(), alias(), condition(), createGroupedSelectionInstance(), createRow(), createSelectionInstance(), current(), fetch(), fetchAll(), fetchAssoc(), fetchField(), fetchPairs(), get(), getDataRefreshed(), getGeneralCacheKey(), getName(), getPreviousAccessedColumns(), getPrimary(), getPrimarySequence(), getReferencedTable(), getReferencingTable(), getSpecificCacheKey(), getSql(), getSqlBuilder(), group(), having(), joinWhere(), key(), limit(), max(), min(), next(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), page(), query(), removeAccessColumn(), rewind(), saveCacheState(), setPrimarySequence(), sum(), valid(), where(), whereOr(), wherePrimary()
Methods used from Nette\SmartObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Magic methods inherited from Nette\Database\Table\IRowContainer
fetch()
Properties summary
protected Nette\Database\Table\Selection $refTable

referenced table

referenced table

#
protected mixed $refCacheCurrent

current assigned referencing array

current assigned referencing array

#
protected string $column

grouping column name

grouping column name

#
protected integer $active

primary key

primary key

#
Properties inherited from Nette\Database\Table\Selection
$accessedColumns, $aggregation, $cache, $context, $conventions, $data, $dataRefreshed, $generalCacheKey, $globalRefCache, $keys, $name, $observeCache, $previousAccessedColumns, $primary, $primarySequence, $refCache, $rows, $specificCacheKey, $sqlBuilder
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0