static string exactNumberCondition(
string
$field, mixed
$value
)
|
|
Generate a searchcondition that check number/decimal literal values
Parameters:
|
string |
$field: |
full qualified table column |
|
mixed |
$value: |
integer/float/double etc. |
API Tags:
| Return: | piece of where clause to use in your SQL statement |
| Access: | public |
atkQuery addCondition(
string
$condition
)
|
|
Add a query condition (conditions are where-expressions that are AND-ed)
Parameters:
|
string |
$condition: |
Condition |
API Tags:
| Return: | The query object itself (for fluent usage) |
| Access: | public |
atkQuery &addExpression(
string
$fieldName, string
$expression, [string
$fieldAliasPrefix = ""], [bool
$quoteFieldName = false]
)
|
|
Add's an expression to the select query
Parameters:
|
string |
$fieldName: |
expression field name |
|
string |
$expression: |
expression value |
|
string |
$fieldAliasPrefix: |
field alias prefix |
|
bool |
$quoteFieldName: |
wether or not to quote the expression field name |
API Tags:
| Return: | The query object itself (for fluent usage) |
atkQuery &addField(
string
$name, [string
$value = ""], [string
$table = ""], [string
$fieldaliasprefix = ""], [bool
$quote = true], [bool
$quotefield = false]
)
|
|
Add's a field to the query
Parameters:
|
string |
$name: |
Field name |
|
string |
$value: |
Field value |
|
string |
$table: |
Table name |
|
string |
$fieldaliasprefix: |
Field alias prefix |
|
bool |
$quote: |
If this parameter is true, stuff is inserted into the db using quotes, e.g. SET name = 'piet'. If it is false, it's done without quotes, e.d. SET number = 4. |
|
bool |
$quotefield: |
Wether or not to quote the fieldname |
API Tags:
| Return: | The query object itself (for fluent usage) |
Redefined in descendants as:
atkQuery addFields(
$fields, [string
$table = ""], [string
$fieldaliasprefix = ""], [bool
$quote = true], [bool
$quotefield = false]
)
|
|
Add multiple fields at once
Parameters:
|
array |
$fields: |
array with field value pairs |
|
string |
$table: |
Table name |
|
string |
$fieldaliasprefix: |
Field alias prefix |
|
bool |
$quote: |
If this parameter is true, stuff is inserted into the db using quotes, e.g. SET name = 'piet'. If it is false, it's done without quotes, e.d. SET number = 4. |
|
bool |
$quotefield: |
Wether or not to quote the fieldname |
API Tags:
| Return: | The query object itself (for fluent usage) |
Add a group-by statement
Parameters:
|
String |
$element: |
Group by expression |
API Tags:
| Return: | The query object itself (for fluent usage) |
atkQuery &addJoin(
string
$table, string
$alias, string
$condition, [bool
$outer = false]
)
|
|
Add join to Join Array
Parameters:
|
string |
$table: |
Table name |
|
string |
$alias: |
Alias of table |
|
string |
$condition: |
Condition for the Join |
|
bool |
$outer: |
Wether to use an outer (left) join or an inner join |
API Tags:
| Return: | The query object itself (for fluent usage) |
Redefined in descendants as:
Add order-by statement
Parameters:
|
String |
$element: |
Order by expression |
API Tags:
| Return: | The query object itself (for fluent usage) |
atkQuery &addSearchCondition(
string
$condition
)
|
|
Add search condition to the query. Basically similar to addCondition, but searchconditions make use of the searchmode setting to determine whether the different searchconditions should be and'ed or or'ed.
Parameters:
|
string |
$condition: |
Condition |
API Tags:
| Return: | The query object itself (for fluent usage) |
atkQuery addSequenceField(
string
$fieldName,
&$value, [string
$seqName = null], int
$value
)
|
|
Add's a sequence field to the query.
Parameters:
|
string |
$fieldName: |
field name |
|
int |
$value: |
field to store the new sequence value in, note certain drivers might populate this field only after the insert query has been executed |
|
string |
$seqName: |
sequence name (optional for certain drivers) |
|
|
&$value: |
|
API Tags:
Redefined in descendants as:
atkQuery &addTable(
string
$name, [string
$alias = ""]
)
|
|
Add table to Tables array
Parameters:
|
string |
$name: |
Table name |
|
string |
$alias: |
Alias of table |
API Tags:
| Return: | The query object itself (for fluent usage) |
unknown betweenCondition(
String
$field, Mixed
$value1, Mixed
$value2, [Bool
$quote = true]
)
|
|
Get the between condition
Parameters:
|
String |
$field: |
The database field |
|
Mixed |
$value1: |
The first value |
|
Mixed |
$value2: |
The second value |
|
Bool |
$quote: |
Add quotes? |
String buildCount(
[bool
$distinct = FALSE]
)
|
|
Builds the SQL Select COUNT(*) query. This is different from select, because we do joins, like in a select, but we don't really select the fields.
Parameters:
|
bool |
$distinct: |
distinct rows? |
API Tags:
| Return: | a SQL Select COUNT(*) Query |
Redefined in descendants as:
-
atkDb2Query::buildCount()
: Builds the SQL Select COUNT(*) query. This is different from select, because we do joins, like in a select, but we don't really select the fields.
-
atkMysqlQuery::buildCount()
: Builds the SQL Select COUNT(*) query. This is different from select, because we do joins, like in a select, but we don't really select the fields.
-
atkOci9Query::buildCount()
: Builds the SQL Select COUNT(*) query. This is different from select, because we do joins, like in a select, but we don't really select the fields.
-
atkPgsqlQuery::buildCount()
: Builds the SQL Select COUNT(*) query. This is different from select, because we do joins, like in a select, but we don't really select the fields.
Builds the SQL Delete query
API Tags:
| Return: | a SQL Delete Query |
Builds the SQL Insert query
API Tags:
| Return: | a SQL Insert Query |
Redefined in descendants as:
String buildSelect(
[bool
$distinct = FALSE]
)
|
|
Builds the SQL Select query
Parameters:
|
bool |
$distinct: |
distinct records? |
API Tags:
| Return: | a SQL Select Query |
Redefined in descendants as:
Builds the SQL Update query
API Tags:
| Return: | a SQL Update Query |
Clear expression list.
API Tags:
Clear field list.
API Tags:
atkQuery &create(
[string
$basepath = "atk.db."]
)
|
|
Static factory method. This method returns a new instance of a query object for the current database.
Parameters:
|
string |
$basepath: |
The basepath for the database object (defaults to 'atk.db') |
API Tags:
| Return: | A Query object for the appropriate database |
void deAlias(
&$record, array
$record
)
|
|
Search Alias in alias array
Parameters:
|
array |
$record: |
Array with fields |
|
|
&$record: |
|
string exactCondition(
string
$field, mixed
$value, [string
$dbFieldType = null]
)
|
|
Generate a searchcondition that checks whether $value matches $field exactly.
Parameters:
|
string |
$field: |
full qualified table column |
|
mixed |
$value: |
string/number/decimal expected column value |
|
string |
$dbFieldType: |
help determine exact search method |
API Tags:
| Return: | piece of where clause to use in your SQL statement |
Wrapper function to execute a delete query
Wrapper function to execute an insert query
Redefined in descendants as:
array executeSelect(
[boolean
$distinct = FALSE]
)
|
|
Wrapper function to execute a select query.
Parameters:
|
boolean |
$distinct: |
Set to true to perform a distinct select, false for a regular select. |
API Tags:
| Return: | The set of records returned by the database. |
| Access: | public |
Wrapper function to execute an update query
Redefined in descendants as:
Returns the database instance.
API Tags:
| Return: | database instance |
| Access: | public |
void greaterthanCondition(
String
$field, String
$value
)
|
|
Generate searchcondition with greater than
Parameters:
|
String |
$field: |
The database field |
|
String |
$value: |
The value |
void greaterthanequalCondition(
String
$field, String
$value
)
|
|
Generate searchcondition with greater than
Parameters:
|
String |
$field: |
The database field |
|
String |
$value: |
The value |
void lessthanCondition(
String
$field, String
$value
)
|
|
Generate searchcondition with less than
Parameters:
|
String |
$field: |
The database field |
|
String |
$value: |
The value |
void lessthanequalCondition(
String
$field, String
$value
)
|
|
Generate searchcondition with less than
Parameters:
|
String |
$field: |
The database field |
|
String |
$value: |
The value |
void notNullCondition(
String
$field, [Bool
$emptyStringIsNull = false]
)
|
|
Generate a searchcondition that checks if the field is not null.
Parameters:
|
String |
$field: |
|
|
Bool |
$emptyStringIsNull: |
|
void nullCondition(
String
$field, [Bool
$emptyStringIsNull = false]
)
|
|
Generate a searchcondition that checks if the field is null.
Parameters:
|
String |
$field: |
|
|
Bool |
$emptyStringIsNull: |
|
The quoteField(
String
$field
)
|
|
If we set a m_fieldquote you can pass a field to this function and it will quote all the identifiers (db, table, column, etc...) in the field.
Parameters:
|
String |
$field: |
The field to add quotes too |
API Tags:
| Return: | quoted field, if we have a fieldquote |
Array quoteFields(
Array
$fields
)
|
|
Quote an array of fields if m_fieldquote is set.
Uses $this->quoteField($field)
Parameters:
|
Array |
$fields: |
The fields to add quotes to |
API Tags:
| Return: | The quoted fields |
Sets the database instance.
Parameters:
API Tags:
Set the 'distinct' mode for the query.
If set to true, a 'SELECT DISTINCT' will be performed. If set to false, a regular 'SELECT' will be performed.
Parameters:
|
Bool |
$distinct: |
Set to true to perform a distinct select, false for a regular select. |
API Tags:
| Return: | The query object itself (for fluent usage) |
atkQuery &setLimit(
int
$offset, int
$limit
)
|
|
Set a limit to the number of results.
Parameters:
|
int |
$offset: |
Retrieve records starting with record ... |
|
int |
$limit: |
Retrieve only this many records. |
API Tags:
| Return: | The query object itself (for fluent usage) |
void setSearchMethod(
string
$searchMethod
)
|
|
Sets this queries search method.
Parameters:
|
string |
$searchMethod: |
search method |
API Tags:
String substringCondition(
String
$field, String
$value
)
|
|
Generate a searchcondition that checks whether $field contains $value .
Parameters:
|
String |
$field: |
The field |
|
String |
$value: |
The value |
API Tags:
| Return: | The substring condition |
Redefined in descendants as:
void wildcardCondition(
String
$field, String
$value
)
|
|
Generate a searchcondition that accepts '*' as wildcard character.
Parameters:
|
String |
$field: |
|
|
String |
$value: |
|
void _addFrom(
&$query, String
$query
)
|
|
Add FROM clause to query.
Parameters:
|
String |
$query: |
The query |
|
|
&$query: |
|
Redefined in descendants as:
-
atkMysqliQuery::_addFrom()
: Overriding the _addFrom function to support a change that was made in MySQL 5.0.15 to make MySQL more compliant with the standard.
void _addLimiter(
&$query, string
$query
)
|
|
Add limiting clauses to the query.
Default implementation: no limit supported. Derived classes should implement this.
Parameters:
|
string |
$query: |
The query to add the limiter to |
|
|
&$query: |
|
Redefined in descendants as:
void _addOrderBy(
&$query, String
$query
)
|
|
Add the ORDER BY clause
Parameters:
|
String |
$query: |
The query |
|
|
&$query: |
|
Redefined in descendants as: