Summary
- File
- Package hierarchy IO\DB
- Class hierarchy \DBQuerier
- Implements \SQLQuerier
implements some simple queries
implements some simple queries
__construct(\SQLQuerier $querier)
\SQLQuerier | $querier |
None found |
select(string $query, \string[string] $parameters = array(), $fetch_mode = \SelectQueryResult::FETCH_ASSOC) : \SelectQueryResult
executes the <code>$query</code> 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
string | $query | the query to execute |
\string[string] | $parameters | the query_var map |
$fetch_mode |
the query result set
None found |
inject(string $query, \string[string] $parameters = array()) : \InjectQueryResult
executes the <code>$query</code> 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
string | $query | the query to execute |
\string[string] | $parameters | the query_var map |
the query result
None found |
enable_query_translator()
None found |
disable_query_translator()
None found |
get_executed_requests_count()
None found |
truncate(string $table_name)
Removes all table rows
string | $table_name | the table name |
None found |
insert(string $table_name, \string[string] $columns) : \InjectQueryResult
insert the values into the <code>$table_name</code> table
string | $table_name | the name of the table on which work will be done |
\string[string] | $columns | the map where columns are keys and values values |
the query result set
None found |
update(string $table_name, \string[string] $columns, string $condition, \string[string] $parameters = array()) : \InjectQueryResult
update the values of rows matching the <code>$condition</code> into the <code>$table_name</code> table
string | $table_name | the name of the table on which work will be done |
\string[string] | $columns | the map where columns are keys and values values |
string | $condition | the update condition beginning just after the where clause.
For example, |
\string[string] | $parameters | the query_var map |
the query result set
None found |
delete(string $table_name, string $condition, \string[string] $parameters = array())
delete all the row from the <code>$table_name</code> table matching the <code>$condition</code> condition
string | $table_name | the name of the table on which work will be done |
string | $condition | the update condition beginning just after the from clause.
For example, |
\string[string] | $parameters | the query_var map |
None found |
select_single_row(string $table_name, array<mixed,string> $columns, string $condition, \string[string] $parameters = array()) : \mixed[string]
retrieve a single row from the <code>$table_name</code> table matching the <code>$condition</code> condition
string | $table_name | the name of the table on which work will be done |
array<mixed,string> | $columns | the columns to retrieve. |
string | $condition | the update condition beginning just after the where clause.
For example, |
\string[string] | $parameters | the query_var map |
the row returned
None found |
select_single_row_query(string $query, \string[string] $parameters = array()) : mixed
retrieve a single row for executes the <code>$query</code> sql request and returns row
string | $query | the query to execute |
\string[string] | $parameters | the query_var map |
the value of the returned row
None found |
row_exists(string $table_name, string $condition, \string[string] $parameters = array()) : boolean
Returns true if a or multiple rows match the given condition.
string | $table_name | the name of the table on which work will be done |
string | $condition | the condition beginning just after the where clause.
For example, |
\string[string] | $parameters | the query_var map |
true if a or multiple rows match the given condition.
None found |
get_column_value(string $table_name, string $column, string $condition, \string[string] $parameters = array()) : mixed
retrieve a single value of the <code>$column</code> column of a single row from the <code>$table_name</code> table matching the <code>$condition</code> condition.
string | $table_name | the name of the table on which work will be done |
string | $column | the column to retrieve. |
string | $condition | the update condition beginning just after the where clause.
For example, |
\string[string] | $parameters | the query_var map |
the value of the returned row
None found |
select_rows(string $table_name, array<mixed,string> $columns, string $condition = 'WHERE 1', \string[string] $parameters = array()) : \mixed[string]
retrieve rows from the <code>$table_name</code> table matching the <code>$condition</code> condition
string | $table_name | the name of the table on which work will be done |
array<mixed,string> | $columns | the columns to retrieve. |
string | $condition | the update condition beginning just after the where clause.
For example, |
\string[string] | $parameters | the query_var map |
the row returned
None found |
count(string $table_name, string $condition = 'WHERE 1', \string[string] $parameters = array(), string $count_column = '*') : integer
count the number of rows from the <code>$table_name</code> table matching the <code>$condition</code> condition
string | $table_name | the name of the table on which work will be done |
string | $condition | the update condition beginning just after the where clause.
For example, |
\string[string] | $parameters | the query_var map |
string | $count_column | the column name on which count or * if all |
the number of rows returned
None found |
get_querier()
None found |