PdbSimpleCondition
in package
implements
PdbConditionInterface
Table of Contents
Interfaces
Constants
- BEGINS : mixed = 'BEGINS'
- BETWEEN : mixed = 'BETWEEN'
- CONTAINS : mixed = 'CONTAINS'
- ENDS : mixed = 'ENDS'
- EQUAL : mixed = '='
- GREATER_THAN : mixed = '>'
- GREATER_THAN_EQUAL : mixed = '>='
- IN : mixed = 'IN'
- IN_SET : mixed = 'IN SET'
- IS : mixed = 'IS'
- IS_NOT : mixed = 'IS NOT'
- LESS_THAN : mixed = '<'
- LESS_THAN_EQUAL : mixed = '<='
- LIKE : mixed = 'LIKE'
- NOT_EQUAL : mixed = '!='
- NOT_EQUAL_ALT : mixed = '<>'
- NOT_IN : mixed = 'NOT IN'
- OPERATORS : mixed = [self::EQUAL, self::LESS_THAN_EQUAL, self::GREA...
Properties
- $bind_type : string|null
- This controls the bind method of the 'value'.
- $column : string
- $operator : string
- $value : mixed
Methods
- __construct() : mixed
- Create a condition.
- __toString() : mixed
- build() : string
- Build an appropriate SQL clause for this condition.
- getPreviewSql() : string
- validate() : void
- Validate this condition.
- quoteLike() : mixed
Constants
BEGINS
public
mixed
BEGINS
= 'BEGINS'
BETWEEN
public
mixed
BETWEEN
= 'BETWEEN'
CONTAINS
public
mixed
CONTAINS
= 'CONTAINS'
ENDS
public
mixed
ENDS
= 'ENDS'
EQUAL
public
mixed
EQUAL
= '='
GREATER_THAN
public
mixed
GREATER_THAN
= '>'
GREATER_THAN_EQUAL
public
mixed
GREATER_THAN_EQUAL
= '>='
IN
public
mixed
IN
= 'IN'
IN_SET
public
mixed
IN_SET
= 'IN SET'
IS
public
mixed
IS
= 'IS'
IS_NOT
public
mixed
IS_NOT
= 'IS NOT'
LESS_THAN
public
mixed
LESS_THAN
= '<'
LESS_THAN_EQUAL
public
mixed
LESS_THAN_EQUAL
= '<='
LIKE
public
mixed
LIKE
= 'LIKE'
NOT_EQUAL
public
mixed
NOT_EQUAL
= '!='
NOT_EQUAL_ALT
public
mixed
NOT_EQUAL_ALT
= '<>'
NOT_IN
public
mixed
NOT_IN
= 'NOT IN'
OPERATORS
public
mixed
OPERATORS
= [self::EQUAL, self::LESS_THAN_EQUAL, self::GREATER_THAN_EQUAL, self::LESS_THAN, self::GREATER_THAN, self::NOT_EQUAL, self::NOT_EQUAL_ALT, self::IS, self::IS_NOT, self::BETWEEN, self::IN, self::NOT_IN, self::LIKE, self::CONTAINS, self::BEGINS, self::ENDS, self::IN_SET]
Properties
$bind_type
This controls the bind method of the 'value'.
public
string|null
$bind_type
-
Given
nullthis uses parametric binding. This is the safest method. -
Use the
FIELDtype to treat the 'value' as a column/table type. This will apply the appropriate quoting method. -
The
VALUEtype will use the PDO driver's 'quote()' method. However this is still not as safe as using natural bindings.
Pdb::QUOTE_FIELD|QUOTE_VALUE|null
$column
public
string
$column
$operator
public
string
$operator
$value
public
mixed
$value
Methods
__construct()
Create a condition.
public
__construct(string $operator, string $column, mixed $value[, string|null $bind = null ]) : mixed
Parameters
- $operator : string
- $column : string
- $value : mixed
- $bind : string|null = null
__toString()
public
__toString() : mixed
Tags
build()
Build an appropriate SQL clause for this condition.
public
build(Pdb $pdb, array<string|int, mixed> &$values) : string
Parameters
- $pdb : Pdb
- $values : array<string|int, mixed>
Tags
Return values
stringgetPreviewSql()
public
getPreviewSql() : string
Tags
Return values
stringvalidate()
Validate this condition.
public
validate() : void
Tags
quoteLike()
private
quoteLike(Pdb $pdb, array<string|int, mixed> &$values) : mixed
Parameters
- $pdb : Pdb
- $values : array<string|int, mixed>