PHP Class DB_dsql, atk4

Inheritance: extends AbstractModel, implements Iterator
Afficher le fichier Open project: atk4/atk4 Class Usage Examples

Méthodes publiques

Свойство Type Description
$_iterating
$args array Data accumulated by calling Definition methods, which is then used when rendering.
$bt string Backtics are added around all fields. Set this to blank string to avoid.
$data {{{ Iterator support
$debug boolean Call $q->debug() to turn on debugging or $q->debug(false) to turn ir off.
$default_exception string Class name of default exception
$default_field string | DB_dsql If no fields are defined, this field is used.
$extra_params array Manually-specified params
$id_field string Required for non-id based tables.
$main_table boolean | string Used to determine main table.
$mode string Mode is initialized to "select" by default.
$output_mode string When you convert this object to string, the following happens:
$owner Owner of this object
$param_base string Prefix for all parameteric variables: a, a_2, a_3, etc.
$params array List of PDO parametical arguments for a query. Used only during rendering.
$preexec
$sql_templates Templates are used to construct most common queries. Templates may be changed in vendor-specific implementation of dsql (extending this class).
$stmt PDOStatement PDO statement if query is prepared. Used by iterator.
$template string Expression to use when converting to string

Méthodes publiques

Méthode Description
SQLTemplate ( string $mode ) Switch template for this query. Determines what would be done on execute.
__clone ( )
__toString ( ) : string Convert object to string - generate SQL expression
_render ( ) : string Helper for render(), which does the actual work.
_render_where ( string $kind ) : array Subroutine which renders either [where] or [having].
_setArray ( mixed $values, string $name, boolean $parse_commas = true ) Internal method which can be used by simple param-giving methods such as option(), group(), etc.
_unique ( &$array, $desired = null ) {{{ Generic routines
andExpr ( ) : DB_dsql Shortcut to produce expression for series of conditions concatinated with "and". Useful to be passed inside where() or join().
args ( array $args ) set arguments for call(). Used by fx() and call() but you can use This with ->expr("in ([args])")->args($values);.
bt ( mixed $s ) : string Adds backtics around argument. This will allow you to use reserved SQL words as table or field names such as "table".
calcFoundRows ( ) Sets flag to hint SQL (if supported) to prepare total number of columns.
calc_found_rows ( )
call ( string $fx, array $args = null ) Sets a template for a user-defined method call with specified arguments.
concat ( ) : DB_dsql Return expression for concatinating multiple values Accepts variable number of arguments, all of them would be escaped.
consume ( string | Field | DB_dsql $dsql, boolean $tick = true ) : string Recursively renders sub-query or expression, combining parameters.
count ( string | object $arg = null ) : DB_dsql Creates expression for COUNT().
current ( )
debug ( boolean | string $msg = true ) This is identical to AbstractObject::debug(), but as an object will refer to the $owner. This is to avoid string-casting and messing up with the DSQL string.
del ( string $args ) Removes definition for argument. $q->del('where'), $q->del('fields') etc.
delete ( ) Executes delete query.
describe ( string $table = null ) : DB_dsql Creates a query for listing tables in databse-specific form Agile Toolkit DSQL does not pretend to know anything about model structure, so result parsing is up to you.
do_getAll ( )
do_getAllHash ( )
do_getHash ( )
do_getOne ( )
do_getRow ( )
do_insert ( )
do_replace ( )
do_select ( )
do_update ( )
dsql ( ) : DB_dsql Create new dsql object linked with the same database connection and bearing same data-type. You can use this method to create sub-queries.
escape ( string $val ) : string Converts value into parameter and returns reference. Use only during query rendering. Consider using consume() instead.
execute ( ) Executes current query.
expr ( string $expr, array $tags = [] ) : DB_dsql Returns new dynamic query and initializes it to use specific template.
fetch ( integer $mode = PDO::FETCH_ASSOC ) : mixed Will execute the query (if it's not executed already) and return first row.
fetchAll ( )
field ( string | array $field, string $table = null, string $alias = null ) Adds new column to resulting select by querying $field.
fieldQuery ( string | array $field, string $table = null, string $alias = null ) : DB_dsql Removes all field definitions and returns only field you specify as parameter to this method. Original query is not affected ($this) Same as for field() syntax.
foundRows ( ) : integer After fetching data, call this to find out how many rows there were in total. Call calcFoundRows() for better performance.
fx ( string $fx, array $args = null ) Executes a standard function with arguments, such as IF.
get ( ) : array Will execute DSQL query and return all results inside array of hashes.
getAll ( )
getDebugQuery ( string $r = null ) : string Return formatted debug output.
getField ( string $fld ) : DB_dsql Return expression containing a properly escaped field. Use make subquery condition reference parent query.
getHash ( ) : array Will execute DSQL query and return first row as hash (column=>value).
getOne ( ) : string Will execute DSQL query and return first column of a first row.
getRow ( ) : array Will execute DSQL query and return first row as array (not hash). If you call several times will return subsequent rows.
group ( string | object $group ) Implemens GROUP BY functionality. Simply pass either string field or expression.
hasInsertOption ( string $option ) : boolean Check if specified insert option was previously added.
hasOption ( string $option ) : boolean Check if specified option was previously added.
having ( mixed $field, string $cond = UNDEFINED, string $value = UNDEFINED ) Same syntax as where().
ignore ( ) Sets IGNORE option.
insert ( ) : integer Executes insert query. Returns ID of new record.
insertAll ( array $array ) : array Inserts multiple rows of data. Uses ignore option AVOID using this, might not be implemented correctly.
join ( string $foreign_table, mixed $master_field = null, string $join_kind = null, string $_foreign_alias = null ) Joins your query with another table.
key ( )
limit ( integer $cnt, integer $shift ) Limit how many rows will be returned.
next ( )
option ( string | expresion $option ) Defines query option, such as DISTINCT.
option_insert ( string | expresion $option ) Defines insert query option, such as IGNORE.
option_replace ( string | expresion $option ) Defines replace query option, such as IGNORE.
orExpr ( ) : DB_dsql Shortcut to produce expression which concatinates "where" clauses with "OR" operator.
order ( mixed $order, string | boolean $desc = null ) Orders results by field or Expression. See documentation for full list of possible arguments.
paramBase ( string $param_base ) Change prefix for parametric values. Not really useful.
preexec ( ) Execute query faster, but don't fetch data until iterating started. This can be done if you need to know foundRows() before fetching data.
random ( ) : DB_dsql Returns method for generating random numbers. This is used for ordering table in random order.
render ( ) : string Converts query into string format. This will contain parametric references.
render_andwhere ( ) : string Renders [andwhere].
render_args ( ) : string Renders [args].
render_field ( ) : string Returns template component [field].
render_from ( ) : string Conditionally returns "from", only if table is Specified Do not call directly.
render_fx ( ) : string Renders [fx].
render_group ( ) : string Renders [group].
render_having ( ) : string Renders [having].
render_join ( ) : string Renders [join].
render_limit ( ) : string Renders [limit].
render_options ( ) : string Renders [options].
render_options_insert ( ) : string Renders [options_insert].
render_options_replace ( ) : string Renders [options_replace].
render_order ( ) : string Renders [order].
render_orwhere ( ) : string Renders [orwhere].
render_set ( ) : string Renders [set] for UPDATE query.
render_set_fields ( ) : string Renders [set_fields] for INSERT.
render_set_values ( ) : string Renders [set_values] for INSERT.
render_table ( ) : string Renders part of the template: [table] Do not call directly.
render_table_noalias ( ) : string Returns template component [table_noalias].
render_where ( ) : string Renders [where].
replace ( ) Executes replace query.
reset ( ) Removes all definitions. Start from scratch.
rewind ( )
select ( ) Executes select query.
set ( string $field, mixed $value = UNDEFINED ) Sets field value for INSERT or UPDATE statements.
setCustom ( string | array $tag, string | object $value = null ) Defines a custom tag variable. WARNING: always backtick / escaped argument if it's unsafe.
sum ( string | object $arg ) : DB_dsql Creates expression for SUM().
table ( string $table = UNDEFINED, string $alias = UNDEFINED ) Specifies which table to use in this dynamic query. You may specify array to perform operation on multiple tables.
template ( string $template ) Explicitly sets template to your query. Remember to change $this->mode if you switch this.
truncate ( ) Executes truncate query.
update ( ) Executes update query.
useExpr ( string $expr, array $tags = [] ) Change template of existing query instead of creating new one. If unsure use expr().
valid ( )
where ( mixed $field, string $cond = UNDEFINED, string $value = UNDEFINED, string $kind = 'where' ) Adds condition to your query.

Method Details

SQLTemplate() public méthode

By default it is in SELECT mode
public SQLTemplate ( string $mode )
$mode string A key for $this->sql_templates

__clone() public méthode

public __clone ( )

__toString() public méthode

Convert object to string - generate SQL expression
public __toString ( ) : string
Résultat string

_render() public méthode

Helper for render(), which does the actual work.
public _render ( ) : string
Résultat string Resulting query

_render_where() public méthode

Subroutine which renders either [where] or [having].
public _render_where ( string $kind ) : array
$kind string 'where' or 'having'
Résultat array Parsed chunks of query

_setArray() public méthode

Internal method which can be used by simple param-giving methods such as option(), group(), etc.
public _setArray ( mixed $values, string $name, boolean $parse_commas = true )
$values mixed
$name string
$parse_commas boolean

_unique() public méthode

{{{ Generic routines
public _unique ( &$array, $desired = null )

andExpr() public méthode

Shortcut to produce expression for series of conditions concatinated with "and". Useful to be passed inside where() or join().
public andExpr ( ) : DB_dsql
Résultat DB_dsql New dynamic query, won't affect $this

args() public méthode

set arguments for call(). Used by fx() and call() but you can use This with ->expr("in ([args])")->args($values);.
public args ( array $args )
$args array Array with mixed arguments

bt() public méthode

Adds backtics around argument. This will allow you to use reserved SQL words as table or field names such as "table".
public bt ( mixed $s ) : string
$s mixed Any string or array of strings
Résultat string Quoted string

calcFoundRows() public méthode

Use foundRows() to read this afterwards.
public calcFoundRows ( )

calc_found_rows() public méthode

Deprecation: 4.3.2. Naming bug. Use foundRows() instead.
public calc_found_rows ( )

call() public méthode

Sets a template for a user-defined method call with specified arguments.
public call ( string $fx, array $args = null )
$fx string Name of the user defined method
$args array Arguments in mixed form

concat() public méthode

Return expression for concatinating multiple values Accepts variable number of arguments, all of them would be escaped.
public concat ( ) : DB_dsql
Résultat DB_dsql clone of $this

consume() public méthode

If the argument is more likely to be a field, use tick=true.
public consume ( string | Field | DB_dsql $dsql, boolean $tick = true ) : string
$dsql string | Field | DB_dsql Expression
$tick boolean Preferred quoted style
Résultat string Quoted expression

count() public méthode

Creates expression for COUNT().
public count ( string | object $arg = null ) : DB_dsql
$arg string | object Typically fieldname or expression of a sub-query
Résultat DB_dsql clone of $this

current() public méthode

public current ( )

debug() public méthode

This is identical to AbstractObject::debug(), but as an object will refer to the $owner. This is to avoid string-casting and messing up with the DSQL string.
public debug ( boolean | string $msg = true )
$msg boolean | string "true" to start debugging

del() public méthode

Removes definition for argument. $q->del('where'), $q->del('fields') etc.
public del ( string $args )
$args string Could be 'field', 'where', 'order', 'limit', etc

delete() public méthode

Executes delete query.
public delete ( )

describe() public méthode

Creates a query for listing tables in databse-specific form Agile Toolkit DSQL does not pretend to know anything about model structure, so result parsing is up to you.
public describe ( string $table = null ) : DB_dsql
$table string Table
Résultat DB_dsql clone of $this

do_getAll() public méthode

public do_getAll ( )

do_getAllHash() public méthode

public do_getAllHash ( )

do_getHash() public méthode

public do_getHash ( )

do_getOne() public méthode

public do_getOne ( )

do_getRow() public méthode

public do_getRow ( )

do_insert() public méthode

Deprecation: 4.3.0 use insert()
public do_insert ( )

do_replace() public méthode

Deprecation: 4.3.0 use replace()
public do_replace ( )

do_select() public méthode

Deprecation: 4.3.0 use select()
public do_select ( )

do_update() public méthode

Deprecation: 4.3.0 use update()
public do_update ( )

dsql() public méthode

Create new dsql object linked with the same database connection and bearing same data-type. You can use this method to create sub-queries.
public dsql ( ) : DB_dsql
Résultat DB_dsql Empty query for same database

escape() public méthode

Converts value into parameter and returns reference. Use only during query rendering. Consider using consume() instead.
public escape ( string $val ) : string
$val string String literal containing input data
Résultat string Safe and escapeed string

execute() public méthode

Executes current query.
public execute ( )

expr() public méthode

Returns new dynamic query and initializes it to use specific template.
public expr ( string $expr, array $tags = [] ) : DB_dsql
$expr string SQL Expression. Don't pass unverified input
$tags array Array of tags and values. @see setCustom()
Résultat DB_dsql New dynamic query, won't affect $this

fetch() public méthode

Will execute the query (if it's not executed already) and return first row.
public fetch ( integer $mode = PDO::FETCH_ASSOC ) : mixed
$mode integer PDO fetch mode
Résultat mixed return result of PDO::fetch

fetchAll() public méthode

public fetchAll ( )

field() public méthode

Examples: $q->field('name'); Second argument specifies table for regular fields $q->field('name','user'); $q->field('name','user')->field('line1','address'); Array as a first argument will specify mulitple fields, same as calling field() multiple times $q->field(array('name','surname')); Associative array will assume that "key" holds the alias. Value may be object. $q->field(array('alias'=>'name','alias2'=>surname')); $q->field(array('alias'=>$q->expr(..), 'alias2'=>$q->dsql()->.. )); You may use array with aliases together with table specifier. $q->field(array('alias'=>'name','alias2'=>surname'),'user'); You can specify $q->expr() for calculated fields. Alias is mandatory. $q->field( $q->expr('2+2'),'alias'); // must always use alias You can use $q->dsql() for subqueries. Alias is mandatory. $q->field( $q->dsql()->table('x')... , 'alias'); // must always use alias
public field ( string | array $field, string $table = null, string $alias = null )
$field string | array Specifies field to select
$table string Specify if not using primary table
$alias string Specify alias for this field

fieldQuery() public méthode

Removes all field definitions and returns only field you specify as parameter to this method. Original query is not affected ($this) Same as for field() syntax.
public fieldQuery ( string | array $field, string $table = null, string $alias = null ) : DB_dsql
$field string | array Specifies field to select
$table string Specify if not using primary table
$alias string Specify alias for this field
Résultat DB_dsql Clone of $this with only one field

foundRows() public méthode

After fetching data, call this to find out how many rows there were in total. Call calcFoundRows() for better performance.
public foundRows ( ) : integer
Résultat integer number of results

fx() public méthode

$q->fx('if', array($condition, $if_true, $if_false));
public fx ( string $fx, array $args = null )
$fx string Name of the built-in method
$args array Arguments

get() public méthode

Will execute DSQL query and return all results inside array of hashes.
public get ( ) : array
Résultat array Array of associative arrays

getAll() public méthode

public getAll ( )

getDebugQuery() public méthode

Return formatted debug output.
public getDebugQuery ( string $r = null ) : string
$r string Rendered material
Résultat string SQL syntax of query

getField() public méthode

Return expression containing a properly escaped field. Use make subquery condition reference parent query.
public getField ( string $fld ) : DB_dsql
$fld string Field in SQL table
Résultat DB_dsql Expression pointing to specified field

getHash() public méthode

Will execute DSQL query and return first row as hash (column=>value).
public getHash ( ) : array
Résultat array Hash of next row in data stream

getOne() public méthode

You can also simply cast your DSQL into string to get this value echo $dsql;
public getOne ( ) : string
Résultat string Value of first column in first row

getRow() public méthode

Will execute DSQL query and return first row as array (not hash). If you call several times will return subsequent rows.
public getRow ( ) : array
Résultat array Next row of your data (not hash)

group() public méthode

Implemens GROUP BY functionality. Simply pass either string field or expression.
public group ( string | object $group )
$group string | object Group by this

hasInsertOption() public méthode

Check if specified insert option was previously added.
public hasInsertOption ( string $option ) : boolean
$option string Which option to check?
Résultat boolean

hasOption() public méthode

Check if specified option was previously added.
public hasOption ( string $option ) : boolean
$option string Which option to check?
Résultat boolean

having() public méthode

Same syntax as where().
public having ( mixed $field, string $cond = UNDEFINED, string $value = UNDEFINED )
$field mixed Field, array for OR or Expression
$cond string Condition such as '=', '>' or 'is not'
$value string Value. Will be quoted unless you pass expression

ignore() public méthode

Sets IGNORE option.
public ignore ( )

insert() public méthode

Executes insert query. Returns ID of new record.
public insert ( ) : integer
Résultat integer new record ID (from last_id)

insertAll() public méthode

Inserts multiple rows of data. Uses ignore option AVOID using this, might not be implemented correctly.
public insertAll ( array $array ) : array
$array array Insert multiple rows into table with one query
Résultat array List of IDs

join() public méthode

Examples: $q->join('address'); // on user.address_id=address.id $q->join('address.user_id'); // on address.user_id=user.id $q->join('address a'); // With alias $q->join(array('a'=>'address')); // Also alias Second argument may specify the field of the master table $q->join('address', 'billing_id'); $q->join('address.code', 'code'); $q->join('address.code', 'user.code'); Third argument may specify which kind of join to use. $q->join('address', null, 'left'); $q->join('address.code', 'user.code', 'inner'); Using array syntax you can join multiple tables too $q->join(array('a'=>'address', 'p'=>'portfolio')); You can use expression for more complex joins $q->join('address', $q->orExpr() ->where('user.billing_id=address.id') ->where('user.technical_id=address.id') )
public join ( string $foreign_table, mixed $master_field = null, string $join_kind = null, string $_foreign_alias = null )
$foreign_table string Table to join with
$master_field mixed Field in master table
$join_kind string 'left' or 'inner', etc
$_foreign_alias string Internal, don't use

key() public méthode

public key ( )

limit() public méthode

Limit how many rows will be returned.
public limit ( integer $cnt, integer $shift )
$cnt integer Number of rows to return
$shift integer Offset, how many rows to skip

next() public méthode

public next ( )

option() public méthode

Defines query option, such as DISTINCT.
public option ( string | expresion $option )
$option string | expresion Option to put after SELECT

option_insert() public méthode

Defines insert query option, such as IGNORE.
public option_insert ( string | expresion $option )
$option string | expresion Option to put after INSERT

option_replace() public méthode

Defines replace query option, such as IGNORE.
public option_replace ( string | expresion $option )
$option string | expresion Option to put after REPLACE

orExpr() public méthode

Shortcut to produce expression which concatinates "where" clauses with "OR" operator.
public orExpr ( ) : DB_dsql
Résultat DB_dsql New dynamic query, won't affect $this

order() public méthode

$q->order('name'); $q->order('name desc'); $q->order('name desc, id asc') $q->order('name',true);
public order ( mixed $order, string | boolean $desc = null )
$order mixed Order by
$desc string | boolean true to sort descending

paramBase() public méthode

Change prefix for parametric values. Not really useful.
public paramBase ( string $param_base )
$param_base string prefix to use for param names

preexec() public méthode

Execute query faster, but don't fetch data until iterating started. This can be done if you need to know foundRows() before fetching data.
public preexec ( )

random() public méthode

Returns method for generating random numbers. This is used for ordering table in random order.
public random ( ) : DB_dsql
Résultat DB_dsql clone of $this

render() public méthode

Converts query into string format. This will contain parametric references.
public render ( ) : string
Résultat string Resulting query

render_andwhere() public méthode

Renders [andwhere].
public render_andwhere ( ) : string
Résultat string rendered SQL chunk

render_args() public méthode

Renders [args].
public render_args ( ) : string
Résultat string rendered SQL chunk

render_field() public méthode

Returns template component [field].
public render_field ( ) : string
Résultat string Parsed template chunk

render_from() public méthode

Conditionally returns "from", only if table is Specified Do not call directly.
public render_from ( ) : string
Résultat string Parsed template chunk

render_fx() public méthode

Renders [fx].
public render_fx ( ) : string
Résultat string rendered SQL chunk

render_group() public méthode

Renders [group].
public render_group ( ) : string
Résultat string rendered SQL chunk

render_having() public méthode

Renders [having].
public render_having ( ) : string
Résultat string rendered SQL chunk

render_join() public méthode

Renders [join].
public render_join ( ) : string
Résultat string rendered SQL chunk

render_limit() public méthode

Renders [limit].
public render_limit ( ) : string
Résultat string rendered SQL chunk

render_options() public méthode

Renders [options].
public render_options ( ) : string
Résultat string rendered SQL chunk

render_options_insert() public méthode

Renders [options_insert].
public render_options_insert ( ) : string
Résultat string rendered SQL chunk

render_options_replace() public méthode

Renders [options_replace].
public render_options_replace ( ) : string
Résultat string rendered SQL chunk

render_order() public méthode

Renders [order].
public render_order ( ) : string
Résultat string rendered SQL chunk

render_orwhere() public méthode

Renders [orwhere].
public render_orwhere ( ) : string
Résultat string rendered SQL chunk

render_set() public méthode

Renders [set] for UPDATE query.
public render_set ( ) : string
Résultat string rendered SQL chunk

render_set_fields() public méthode

Renders [set_fields] for INSERT.
public render_set_fields ( ) : string
Résultat string rendered SQL chunk

render_set_values() public méthode

Renders [set_values] for INSERT.
public render_set_values ( ) : string
Résultat string rendered SQL chunk

render_table() public méthode

Renders part of the template: [table] Do not call directly.
public render_table ( ) : string
Résultat string Parsed template chunk

render_table_noalias() public méthode

Returns template component [table_noalias].
public render_table_noalias ( ) : string
Résultat string Parsed template chunk

render_where() public méthode

Renders [where].
public render_where ( ) : string
Résultat string rendered SQL chunk

replace() public méthode

Executes replace query.
public replace ( )

reset() public méthode

Removes all definitions. Start from scratch.
public reset ( )

rewind() public méthode

public rewind ( )

select() public méthode

Executes select query.
public select ( )

set() public méthode

Sets field value for INSERT or UPDATE statements.
public set ( string $field, mixed $value = UNDEFINED )
$field string Name of the field
$value mixed Value of the field

setCustom() public méthode

Defines a custom tag variable. WARNING: always backtick / escaped argument if it's unsafe.
public setCustom ( string | array $tag, string | object $value = null )
$tag string | array Corresponds to [tag] inside template
$value string | object Value for the template tag

sum() public méthode

Creates expression for SUM().
public sum ( string | object $arg ) : DB_dsql
$arg string | object Typically fieldname or expression of a sub-query
Résultat DB_dsql clone of $this

table() public méthode

Examples: $q->table('user'); $q->table('user','u'); $q->table('user')->table('salary') $q->table(array('user','salary')); $q->table(array('user','salary'),'user'); $q->table(array('u'=>'user','s'=>'salary')); If you specify multiple tables, you still need to make sure to add proper "where" conditions. All the above examples return $q (for chaining) You can also call table without arguments, which will return current table: echo $q->table(); If multiple tables are used, "false" is returned. Return is not quoted. Please avoid using table() without arguments as more tables may be dynamically added later.
public table ( string $table = UNDEFINED, string $alias = UNDEFINED )
$table string Specify table to use
$alias string Specify alias for the table

template() public méthode

Explicitly sets template to your query. Remember to change $this->mode if you switch this.
public template ( string $template )
$template string New template to use by render

truncate() public méthode

Executes truncate query.
public truncate ( )

update() public méthode

Executes update query.
public update ( )

useExpr() public méthode

Change template of existing query instead of creating new one. If unsure use expr().
public useExpr ( string $expr, array $tags = [] )
$expr string SQL Expression. Don't pass unverified input
$tags array Obsolete, use templates / setCustom()

valid() public méthode

public valid ( )

where() public méthode

Examples: $q->where('id',1); Second argument specifies table for regular fields $q->where('id>','1'); $q->where('id','>',1); You may use expressions $q->where($q->expr('a=b')); $q->where('date>',$q->expr('now()')); $q->where($q->expr('length(password)'),'>',5); Finally, subqueries can also be used $q->where('foo',$q->dsql()->table('foo')->field('name')); To specify OR conditions $q->where($q->orExpr()->where('a',1)->where('b',1)); you can also use the shortcut: $q->where(array('a is null','b is null'));
public where ( mixed $field, string $cond = UNDEFINED, string $value = UNDEFINED, string $kind = 'where' )
$field mixed Field, array for OR or Expression
$cond string Condition such as '=', '>' or 'is not'
$value string Value. Will be quoted unless you pass expression
$kind string Do not use directly. Use having()

Property Details

$_iterating public_oe property

public $_iterating

$args public_oe property

Data accumulated by calling Definition methods, which is then used when rendering.
public array $args
Résultat array

$bt public_oe property

Backtics are added around all fields. Set this to blank string to avoid.
public string $bt
Résultat string

$data public_oe property

{{{ Iterator support
public $data

$debug public_oe property

Call $q->debug() to turn on debugging or $q->debug(false) to turn ir off.
public bool $debug
Résultat boolean

$default_exception public_oe property

Class name of default exception
public string $default_exception
Résultat string

$default_field public_oe property

If no fields are defined, this field is used.
public string|DB_dsql $default_field
Résultat string | DB_dsql

$extra_params public_oe property

Manually-specified params
public array $extra_params
Résultat array

$id_field public_oe property

Required for non-id based tables.
public string $id_field
Résultat string

$main_table public_oe property

Used to determine main table.
public bool|string $main_table
Résultat boolean | string

$mode public_oe property

Mode is initialized to "select" by default.
public string $mode
Résultat string

$output_mode public_oe property

When you convert this object to string, the following happens:
public string $output_mode
Résultat string

$owner public_oe property

Owner of this object
public $owner

$param_base public_oe property

Prefix for all parameteric variables: a, a_2, a_3, etc.
public string $param_base
Résultat string

$params public_oe property

List of PDO parametical arguments for a query. Used only during rendering.
public array $params
Résultat array

$preexec public_oe property

public $preexec

$sql_templates public_oe property

Templates are used to construct most common queries. Templates may be changed in vendor-specific implementation of dsql (extending this class).
public $sql_templates

$stmt public_oe property

PDO statement if query is prepared. Used by iterator.
public PDOStatement $stmt
Résultat PDOStatement

$template public_oe property

Expression to use when converting to string
public string $template
Résultat string