InCondition
in package
implements
ConditionInterface
Class InCondition represents `IN` condition.
Tags
Table of Contents
Interfaces
- ConditionInterface
- Interface ConditionInterface should be implemented by classes that represent a condition in DBAL of framework.
Properties
- $column : string|array<string|int, string>
- $operator : string
- $values : array<string|int, ExpressionInterface>|array<string|int, string>|array<string|int, int>
Methods
- __construct() : mixed
- SimpleCondition constructor
- fromArrayDefinition() : $this
- Creates object by array-definition as described in [Query Builder – Operator format](guide:db-query-builder#operator-format) guide article.
- getColumn() : mixed
- getOperator() : string
- getValues() : array<string|int, ExpressionInterface>|array<string|int, string>|array<string|int, int>
Properties
$column
private
string|array<string|int, string>
$column
the column name. If it is an array, a composite IN
condition
will be generated.
$operator
private
string
$operator
the operator to use (e.g. IN
or NOT IN
)
$values
private
array<string|int, ExpressionInterface>|array<string|int, string>|array<string|int, int>
$values
an array of values that [[column]] value should be among.
If it is an empty array the generated expression will be a false
value if
[[operator]] is IN
and empty if operator is NOT IN
.
Methods
__construct()
SimpleCondition constructor
public
__construct(mixed $column, string $operator, mixed $values) : mixed
Parameters
- $column : mixed
- $operator : string
-
the operator to use (e.g.
IN
orNOT IN
) - $values : mixed
fromArrayDefinition()
Creates object by array-definition as described in [Query Builder – Operator format](guide:db-query-builder#operator-format) guide article.
public
static fromArrayDefinition(mixed $operator, mixed $operands) : $this
Parameters
- $operator : mixed
-
operator in uppercase.
- $operands : mixed
-
array of corresponding operands
Tags
Return values
$thisgetColumn()
public
getColumn() : mixed
getOperator()
public
getOperator() : string
Return values
stringgetValues()
public
getValues() : array<string|int, ExpressionInterface>|array<string|int, string>|array<string|int, int>