SimpleCondition
API reference › yii › db › conditions › SimpleCondition
1 subclass
Class SimpleCondition represents a simple condition like "column" operator value.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | SimpleCondition constructor | SimpleCondition |
fromArrayDefinition() static | Creates object by array-definition as described in Query Builder – Operator format guide article. | SimpleCondition |
getColumn() | SimpleCondition | |
getOperator() | SimpleCondition | |
getValue() | SimpleCondition |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(mixed $column, string $operator, mixed $value)SimpleCondition constructor
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | mixed | The literal to the left of $operator |
$operator | string | The operator to use. Anything could be used e.g. >, <=, etc. |
$value | mixed | The literal to the right of $operator |
fromArrayDefinition()
Section titled “fromArrayDefinition() ”public static function fromArrayDefinition(mixed $operator, mixed $operands): staticCreates object by array-definition as described in Query Builder – Operator format guide article.
Parameters
| Parameter | Type | Description |
|---|---|---|
$operator | mixed | Operator in uppercase. |
$operands | mixed | Array of corresponding operands |
Returns
static
Throws
yii\base\InvalidArgumentException: if wrong number of operands have been given.