Packages

  • 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
  • PHP

Classes

  • GroupedTableSelection
  • SqlBuilder
  • TableRow
  • TableSelection
  • Overview
  • Package
  • Class
  • Tree

Class GroupedTableSelection

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

Object
Extended by TableSelection implements Iterator, ArrayAccess, Countable
Extended by GroupedTableSelection
Package: Nette\Database\Table
Author: Jakub Vrana
Author: Jan Skrasek
Located at Database/Table/GroupedSelection.php
Methods summary
public
# __construct( TableSelection $refTable, string $table, string $column )

Creates filtered and grouped table representation.

Creates filtered and grouped table representation.

Parameters

$refTable
TableSelection
$table
string
database table name
$column
string
joining column

Overrides

TableSelection::__construct
public TableSelection
# 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

TableSelection
provides a fluent interface

Overrides

TableSelection::select
public TableSelection
# 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

TableSelection
provides a fluent interface

Overrides

TableSelection::order
public string
# aggregation( string $function )

Executes aggregation function.

Executes aggregation function.

Parameters

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

Returns

string

Overrides

TableSelection::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

TableSelection::count

Implementation of

Countable::count
protected
# execute( )

Overrides

TableSelection::execute
protected TableSelection
# getRefTable( & $refPath )

Returns Selection parent for caching

Returns Selection parent for caching

Returns

TableSelection

Overrides

TableSelection::getRefTable
public TableRow
# 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

TableRow
or FALSE in case of an error or number of affected rows for INSERT ... SELECT

Overrides

TableSelection::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

TableSelection::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

TableSelection::delete
Methods inherited from TableSelection
__clone(), __destruct(), createGroupedSelectionInstance(), createRow(), createSelectionInstance(), current(), emptyResultSet(), fetch(), fetchPairs(), find(), get(), getConnection(), getName(), getPrimary(), getReferencedTable(), getReferencingTable(), getSql(), group(), key(), limit(), max(), min(), next(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), page(), query(), rewind(), saveCacheState(), sum(), valid(), where()
Methods inherited from Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Properties summary
protected TableSelection $refTable
#

referenced table

referenced table

protected string $column
#

grouping column name

grouping column name

protected integer $active
#

primary key

primary key

Properties inherited from TableSelection
$accessed, $aggregation, $checkReferenced, $connection, $data, $keys, $name, $observeCache, $prevAccessed, $primary, $referenced, $referencing, $referencingPrototype, $rows, $sqlBuilder
Nette Framework 2.0.5 (for PHP 5.2, un-prefixed) API API documentation generated by ApiGen 2.7.0