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 SqlBuilder

Builds SQL query. SqlBuilder is based on great library NotORM http://www.notorm.com written by Jakub Vrana.

Nette\Database\Table\SqlBuilder uses Nette\SmartObject
Namespace: Nette\Database\Table
Located at Database/Table/SqlBuilder.php
Methods summary
public
# __construct( $tableName, Nette\Database\Context $context )
public string
# getTableName( )

Returns

string
string
public
# buildInsertQuery( )
public
# buildUpdateQuery( )
public
# buildDeleteQuery( )
public string
# getSelectQueryHash( array $columns = null )

Returns select query hash for caching.

Returns select query hash for caching.

Returns

string
string
public string
# buildSelectQuery( array $columns = null )

Returns SQL query.

Returns SQL query.

Parameters

$columns
of columns

Returns

string
string
public array
# getParameters( )

Returns

array
array
public
# importConditions( Nette\Database\Table\SqlBuilder $builder )
public
# addSelect( $columns, ... $params )
public array
# getSelect( )

Returns

array
array
public boolean
# addWhere( $condition, ... $params )

Returns

boolean
bool
public array
# addJoinCondition( $tableChain, $condition, ... $params )

Returns

array
array
protected boolean
# addCondition( $condition, array $params, array & $conditions, array & $conditionsParameters )

Returns

boolean
bool
public array
# getConditions( )

Returns

array
array
public
# addAlias( string $chain, string $alias )

Adds alias.

Adds alias.

Parameters

$chain
$alias
protected
# checkUniqueTableName( string $tableName, string $chain )

Parameters

$tableName
$chain
public
# addOrder( $columns, ... $params )
public
# setOrder( array $columns, array $parameters )
public array
# getOrder( )

Returns

array
array
public
# setLimit( integer|null $limit, integer|null $offset )

Parameters

$limit
$offset
public integer|null
# getLimit( )

Returns

integer|null
int|null
public integer|null
# getOffset( )

Returns

integer|null
int|null
public
# setGroup( $columns, ... $params )
public string
# getGroup( )

Returns

string
string
public
# setHaving( $having, ... $params )
public string
# getHaving( )

Returns

string
string
protected string
# buildSelect( array $columns )

Returns

string
string
protected array
# parseJoinConditions( & $joins, $joinConditions )

Returns

array
array
protected
# getSortedJoins( $table, & $leftJoinDependency, & $tableJoins, & $finalJoins )
protected
# parseJoins( & $joins, & $query )
public string
# parseJoinsCb( & $joins, $match )

Returns

string
string
protected string
# buildQueryJoins( array $joins, array $leftJoinConditions = [] )

Returns

string
string
protected array
# buildJoinConditions( )

Returns

array
array
protected string
# buildConditions( )

Returns

string
string
protected string
# buildQueryEnd( )

Returns

string
string
protected string
# tryDelimite( $s )

Returns

string
string
protected boolean
# addConditionComposition( array $columns, array $parameters, array & $conditions, array & $conditionsParameters )

Returns

boolean
bool
Methods used from Nette\SmartObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Properties summary
protected string $tableName
#
protected Nette\Database\IConventions $conventions
#
protected string $delimitedTable

delimited table name

delimited table name

#
protected array $select

of column to select

of column to select

#[]
protected array $where

of where conditions

of where conditions

#[]
protected array $joinCondition

of array of join conditions

of array of join conditions

#[]
protected array $conditions

of where conditions for caching

of where conditions for caching

#[]
protected array $parameters

of parameters passed to where conditions

of parameters passed to where conditions

#[ 'select' => [], 'joinCondition' => [], 'where' => [], 'group' => [], 'having' => [], 'order' => [], ]
protected array $order

or columns to order by

or columns to order by

#[]
protected integer $limit

number of rows to fetch

number of rows to fetch

#
protected integer $offset

first row to fetch

first row to fetch

#
protected string $group

columns to grouping

columns to grouping

#''
protected string $having

grouping condition

grouping condition

#''
protected array $reservedTableNames

of reserved table names associated with chain

of reserved table names associated with chain

#[]
protected array $aliases

of table aliases

of table aliases

#[]
protected string $currentAlias

currently parsing alias for joins

currently parsing alias for joins

#
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0