Methods summary
public
|
|
public
SelectQueryResult
|
#
select( string $query, string[string] $parameters = array(), $fetch_mode = SelectQueryResult::FETCH_ASSOC )
executes the
$query
sql request and returns the query result.
Query will first be converted into the specific sgbd dialect.
Next query functions will be converted into the specific sgbd dialect.
Then query vars ":sample_query_var" will be replaced by the value of
the $parameters['sample_query_var'] variable if existing.
If not (there's a lot of chance that you have forgotten to register this
query var in the $parameters map), the query var won't be replaced
executes the
$query
sql request and returns the query result.
Query will first be converted into the specific sgbd dialect.
Next query functions will be converted into the specific sgbd dialect.
Then query vars ":sample_query_var" will be replaced by the value of
the $parameters['sample_query_var'] variable if existing.
If not (there's a lot of chance that you have forgotten to register this
query var in the $parameters map), the query var won't be replaced
Parameters
- $query
- the query to execute
- $parameters
- the query_var map
- $fetch_mode
Returns
Implementation of
|
public
InjectQueryResult
|
#
inject( string $query, string[string] $parameters = array() )
executes the
$query
sql request.
Query will first be converted into the specific sgbd dialect.
Next query functions will be converted into the specific sgbd dialect.
Then query vars ":sample_query_var" will be replaced by the value of
the $parameters['sample_query_var'] variable if existing.
If not (there's a lot of chance that you have forgotten to register this
query var in the $parameters map), the query var won't be replaced
executes the
$query
sql request.
Query will first be converted into the specific sgbd dialect.
Next query functions will be converted into the specific sgbd dialect.
Then query vars ":sample_query_var" will be replaced by the value of
the $parameters['sample_query_var'] variable if existing.
If not (there's a lot of chance that you have forgotten to register this
query var in the $parameters map), the query var won't be replaced
Parameters
- $query
- the query to execute
- $parameters
- the query_var map
Returns
Implementation of
|
public
|
|
public
|
|
public
|
|
public
|
#
truncate( string $table_name )
Removes all table rows
Parameters
- $table_name
- the table name
|
public
InjectQueryResult
|
#
insert( string $table_name, array $columns )
insert the values into the
$table_name
table
insert the values into the
$table_name
table
Parameters
- $table_name
- the name of the table on which work will be done
- $columns
- the map where columns are keys and values values
Returns
|
public
InjectQueryResult
|
#
update( string $table_name, array $columns, string $condition, array $parameters = array() )
update the values of rows matching the
$condition
into the
$table_name
table
update the values of rows matching the
$condition
into the
$table_name
table
Parameters
- $table_name
- the name of the table on which work will be done
- $columns
- the map where columns are keys and values values
- $condition
the update condition beginning just after the where clause.
For example,
"length > 50 and weight < 100"
- $parameters
- the query_var map
Returns
|
public
|
#
delete( string $table_name, string $condition, array $parameters = array() )
delete all the row from the
$table_name
table matching the
$condition
condition
delete all the row from the
$table_name
table matching the
$condition
condition
Parameters
- $table_name
- the name of the table on which work will be done
- $condition
the update condition beginning just after the from clause.
For example,
"length > 50 and weight < 100"
- $parameters
- the query_var map
|
public
mixed[string]
|
#
select_single_row( string $table_name, array $columns, string $condition, array $parameters = array() )
retrieve a single row from the
$table_name
table matching the
$condition
condition
retrieve a single row from the
$table_name
table matching the
$condition
condition
Parameters
- $table_name
- the name of the table on which work will be done
- $columns
- the columns to retrieve.
- $condition
the update condition beginning just after the where clause.
For example,
"length > 50 and weight < 100"
- $parameters
- the query_var map
Returns
mixed[string] the row returned
|
public
mixed
|
#
select_single_row_query( string $query, string[string] $parameters = array() )
retrieve a single row for executes the
$query
sql request and returns row
retrieve a single row for executes the
$query
sql request and returns row
Parameters
- $query
- the query to execute
- $parameters
- the query_var map
Returns
mixed the value of the returned row
|
public
boolean
|
#
row_exists( string $table_name, string $condition, array $parameters = array() )
Returns true if a or multiple rows match the given condition.
Returns true if a or multiple rows match the given condition.
Parameters
- $table_name
- the name of the table on which work will be done
- $condition
the condition beginning just after the where clause.
For example,
"WHERE length > 50 and weight < 100"
- $parameters
- the query_var map
Returns
boolean true if a or multiple rows match the given condition.
|
public
mixed
|
#
get_column_value( string $table_name, string $column, string $condition, array $parameters = array() )
retrieve a single value of the
$column
column of a single row from the
$table_name
table matching the
$condition
condition.
retrieve a single value of the
$column
column of a single row from the
$table_name
table matching the
$condition
condition.
Parameters
- $table_name
- the name of the table on which work will be done
- $column
- the column to retrieve.
- $condition
the update condition beginning just after the where clause.
For example,
"length > 50 and weight < 100"
- $parameters
- the query_var map
Returns
mixed the value of the returned row
|
public
mixed[string]
|
#
select_rows( string $table_name, array $columns, string $condition = 'WHERE 1', string[string] $parameters = array() )
retrieve rows from the
$table_name
table matching the
$condition
condition
retrieve rows from the
$table_name
table matching the
$condition
condition
Parameters
- $table_name
- the name of the table on which work will be done
- $columns
- the columns to retrieve.
- $condition
the update condition beginning just after the where clause.
For example,
"length > 50 and weight < 100"
- $parameters
- the query_var map
Returns
mixed[string] the row returned
|
public
integer
|
#
count( string $table_name, string $condition = 'WHERE 1', string $parameters = array(), string[string] $count_column = '*' )
count the number of rows from the
$table_name
table matching the
$condition
condition
count the number of rows from the
$table_name
table matching the
$condition
condition
Parameters
- $table_name
- the name of the table on which work will be done
- $condition
the update condition beginning just after the where clause.
For example,
"length > 50 and weight < 100"
- $parameters
- $count_column the column name on which count or * if all
- $count_column
- $parameters the query_var map
Returns
integer the number of rows returned
|
public
|
|