Class AMysql_Expr
Class for making custom expressions for AMysql value binding. This is what you should use to be able to add specific kinds of purposely unquoted, non-numeric values into prepared statements, such as being able to call mysql functions to set values.
This class can be extended and is recommended to do so if you want custom expressions; in which case you would have to manually instatiate that class each time, rather than using AMysql::expr()
Expression codes 0-999 should be considered reserved to this class; if you extend this class, please use at least 1000 as expression code ints.
Author: Szerémi Attila
Created: 2011.06.10. 13:26:56
Located at AMysql/Expr.php
public
|
|
public
|
|
protected
string
|
#
setByArray( array $args )
This method performs the logic of determining what the expression should result in. When extending this class, it is recommended that you override this method, determine whether the expression code is something that you want to handle, otherwise call and return the parent's setByArray() method |
public
|
|
public
|
|
public
|
|
public
string
|
integer |
LITERAL
|
0 |
#
Literal string |
integer |
EXPR_LITERAL
|
0 |
|
integer |
COLUMN_IN
|
1 |
#
IN() function. In this case, the 2nd parameter is the table name, the third is the array of values |
integer |
EXPR_COLUMN_IN
|
1 |
|
integer |
ESCAPE_LIKE
|
2 |
#
Escapes wildcards for a LIKE statement. The second parameter has to be the string to escape, and the third is optional, and is the sprintf format of the string, where literal wildcards should appear. The default is %%%s%%, where the input of "something" will result in: "'%something%' ESCAPE '='" |
integer |
ESCAPE_TABLE
|
3 |
#
Escapes a table name and encloses it in quotes. The second parameter is the table name. |
integer |
EXPR_TABLE
|
3 |
|
integer |
ESCAPE_COLUMN
|
4 |
#
Escapes a column name and encloses it in quotes. The second parameter is the column name. |
integer |
EXPR_COLUMN
|
4 |
public
mixed
|
$prepared |
|
|
public
mixed
|
$amysql |
|