|
| const | OPR_EQUAL = "=" |
| |
|
const | OPR_DIFF = "<>" |
| |
|
const | OPR_GRTR = ">" |
| |
|
const | OPR_LESS = "<" |
| |
|
const | OPR_GRTREQ = ">=" |
| |
|
const | OPR_LESSEQ = "<=" |
| |
|
const | OPR_IN = "IN" |
| |
|
const | OPR_NOTIN = "NOT IN" |
| |
|
const | OPR_LIKE = "LIKE" |
| |
|
const | OPR_BTWN = "BETWEEN" |
| |
|
const | OPR_NULL = "IS NULL" |
| |
|
const | OPR_NOTNULL = "IS NOT NULL" |
| |
|
|
| $col = "" |
| |
|
| $val = null |
| |
|
| $opr = self::OPR_EQUAL |
| |
|
| $params = [] |
| |
| SlaxWeb\Database\Query\Where\Predicate::_prepValues |
( |
|
$value | ) |
|
Prepare values
Prepare the values by replacing the actual value with the question mark placeholder and add the value to the 'params' array.
- Parameters
-
| mixed | $value | Value to be prepared |
- Returns
- mixed
| SlaxWeb\Database\Query\Where\Predicate::convert |
( |
string |
$table | ) |
|
Convert to string
Convert the Predicate to string. It checks that the value and the comparison operator are valid and an SQL DML can safely be constructed with those values. If not, an exception is thrown.
- Parameters
-
| string | $table | Table name to prepend to columns |
- Returns
- string
| SlaxWeb\Database\Query\Where\Predicate::getParams |
( |
| ) |
|
Get parameters
Returns the list of parameters for this predicate.
- Returns
- array
| SlaxWeb\Database\Query\Where\Predicate::setColumn |
( |
string |
$column | ) |
|
Set column name
Sets the column name and returns itself for method call linking.
- Parameters
-
- Returns
- self
| SlaxWeb\Database\Query\Where\Predicate::setOperator |
( |
string |
$operator | ) |
|
Set comparison operator
Sets the comparison operator for the predicate and returns itself for method call linkint.
- Parameters
-
- Returns
- self
| SlaxWeb\Database\Query\Where\Predicate::setValue |
( |
|
$value, |
|
|
bool |
$prep = true, |
|
|
array |
$params = [] |
|
) |
| |
Set value
Sets the value for the predicate and returns itself for method call linking. If value is NULL or string("NULL"), it automatically sets the comparisson operator to self::OPR_NULL.
- Parameters
-
| mixed | $value | Value of the predicate |
| bool | $prep | Prepare value, default bool(true) |
| array | $params | Predefined parameters, default [] |
- Returns
- self
| const SlaxWeb\Database\Query\Where\Predicate::OPR_EQUAL = "=" |
The documentation for this class was generated from the following file:
- /opt/slax0rDev/slaxweb/database/src/Query/Where/Predicate.php