BetweenCondition
API reference › yii › db › conditions › BetweenCondition
Class BetweenCondition represents a BETWEEN condition.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a condition with the BETWEEN operator. | BetweenCondition |
fromArrayDefinition() static | Creates object by array-definition as described in Query Builder – Operator format guide article. | BetweenCondition |
getColumn() | BetweenCondition | |
getIntervalEnd() | BetweenCondition | |
getIntervalStart() | BetweenCondition | |
getOperator() | BetweenCondition |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(mixed $column, string $operator, mixed $intervalStart, mixed $intervalEnd)Creates a condition with the BETWEEN operator.
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | mixed | The literal to the left of $operator |
$operator | string | The operator to use (e.g. BETWEEN or NOT BETWEEN) |
$intervalStart | mixed | Beginning of the interval |
$intervalEnd | mixed | End of the interval |
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.
getIntervalEnd()
Section titled “getIntervalEnd() ”public function getIntervalEnd(): mixedReturns
mixed
getIntervalStart()
Section titled “getIntervalStart() ”public function getIntervalStart(): mixedReturns
mixed