Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

  • ActiveRow
  • GroupedSelection
  • Selection
  • SqlBuilder
  • 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, 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
# through( $column )

Deprecated

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()
public Nette\Database\Table\ActiveRow
# insert( mixed $data )

Inserts row in a table.

Inserts row in a table.

Parameters

$data
mixed
array($column => $value)|Traversable for single row insert or Selection|string for INSERT ... SELECT

Returns

Nette\Database\Table\ActiveRow
or FALSE in case of an error or number of affected rows for INSERT ... SELECT

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 or FALSE in case of an error

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 or FALSE in case of an error

Overrides

Nette\Database\Table\Selection::delete()
Methods inherited from Nette\Database\Table\Selection
__clone(), __destruct(), createGroupedSelectionInstance(), createRow(), createSelectionInstance(), current(), emptyResultSet(), fetch(), fetchPairs(), find(), get(), getCacheKey(), getConnection(), getDataRefreshed(), getName(), getPrimary(), getPrimarySequence(), getReferencedTable(), getReferencingTable(), getSql(), group(), 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()
Properties summary
protected Nette\Database\Table\Selection $refTable
#

referenced table

referenced table

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, $checkReferenced, $connection, $data, $dataRefreshed, $keys, $name, $observeCache, $previousAccessedColumns, $primary, $primarySequence, $referenced, $referencing, $referencingPrototype, $rows, $sqlBuilder
Magic properties inherited from Nette\Database\Table\Selection
$sql
Magic properties inherited from Nette\Object
$reflection
Nette 2.0 API documentation generated by ApiGen 2.8.0