Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationLatte
      • ApplicationTracy
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsLatte
      • Framework
      • HttpTracy
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy

Classes

  • ActiveRow
  • GroupedSelection
  • Selection
  • SqlBuilder

Interfaces

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

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\Object
Extended by Nette\Database\Table\Selection implements Iterator, Nette\Database\Table\IRowContainer, ArrayAccess, Countable
Extended by Nette\Database\Table\GroupedSelection
Namespace: Nette\Database\Table
Author: Jakub Vrana
Author: Jan Skrasek
Located at Database/Table/GroupedSelection.php
Methods summary
public
# __construct( Nette\Database\Table\Selection $refTable, string $table, string $column )

Creates filtered and grouped table representation.

Creates filtered and grouped table representation.

Parameters

$refTable
Nette\Database\Table\Selection
$refTable
$table
string
database table name
$column
string
joining column

Overrides

Nette\Database\Table\Selection::__construct()
public Nette\Database\Table\GroupedSelection
# select( string $columns )

Adds select clause, more calls appends to the end.

Adds select clause, more calls appends to the end.

Parameters

$columns
string
for example "column, MD5(column) AS column_md5"

Returns

Nette\Database\Table\GroupedSelection

Overrides

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

Adds order clause, more calls appends to the end.

Adds order clause, more calls appends to the end.

Parameters

$columns
string
for example 'column1, column2 DESC'

Returns

Nette\Database\Table\GroupedSelection

Overrides

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

Executes aggregation function.

Executes aggregation function.

Parameters

$function
string
select call in "FUNCTION(column)" format

Returns

string

Overrides

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

Counts number of rows.

Counts number of rows.

Parameters

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

Returns

integer

Overrides

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

Overrides

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

Returns Selection parent for caching.

Returns Selection parent for caching.

Returns

Nette\Database\Table\Selection

Overrides

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

Loads refCache references

Loads refCache references

Overrides

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

Inserts row in a table.

Inserts row in a table.

Parameters

$data
array|Traversable|Nette\Database\Table\Selection
array($column => $value)|\Traversable|Selection for INSERT ... SELECT

Returns

Nette\Database\Table\IRow|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( array|Traversable $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
array|Traversable
($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(), createGroupedSelectionInstance(), createRow(), createSelectionInstance(), current(), emptyResultSet(), fetch(), fetchAll(), fetchPairs(), get(), getConnection(), getDataRefreshed(), getDatabaseReflection(), getGeneralCacheKey(), getName(), getPrimary(), getPrimarySequence(), getReferencedTable(), getReferencingTable(), getSpecificCacheKey(), getSql(), group(), having(), key(), limit(), max(), min(), next(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), page(), query(), rewind(), saveCacheState(), setPrimarySequence(), sum(), valid(), where(), wherePrimary()
Methods inherited from Nette\Object
__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, $connection, $data, $dataRefreshed, $generalCacheKey, $globalRefCache, $keys, $name, $observeCache, $previousAccessedColumns, $primary, $primarySequence, $refCache, $reflection, $rows, $specificCacheKey, $sqlBuilder
Magic properties inherited from Nette\Database\Table\Selection
$sql
Magic properties inherited from Nette\Object
$reflection
Nette 2.2 API documentation generated by ApiGen 2.8.0