0 follower

Abstract Class Yiisoft\Db\QueryBuilder\Condition\AbstractBetween

InheritanceYiisoft\Db\QueryBuilder\Condition\AbstractBetween
ImplementsYiisoft\Db\QueryBuilder\Condition\ConditionInterface
SubclassesYiisoft\Db\QueryBuilder\Condition\Between, Yiisoft\Db\QueryBuilder\Condition\NotBetween

Condition that's represented BETWEEN or NOT BETWEEN operator is used to check if a value is between two values.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Db\QueryBuilder\Condition\AbstractBetween
fromArrayDefinition() Creates a condition based on the given operator and operands. Yiisoft\Db\QueryBuilder\Condition\AbstractBetween

Property Details

Hide inherited properties

$column public property
$intervalEnd public property
public mixed $intervalEnd null
$intervalStart public property
public mixed $intervalStart null

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Db\Expression\ExpressionInterface|string $column, mixed $intervalStart, mixed $intervalEnd )
$column Yiisoft\Db\Expression\ExpressionInterface|string

The column name.

$intervalStart mixed

Beginning of the interval.

$intervalEnd mixed

End of the interval.

                final public function __construct(
    public readonly string|ExpressionInterface $column,
    public readonly mixed $intervalStart,
    public readonly mixed $intervalEnd,
) {}

            
fromArrayDefinition() public static method

Creates a condition based on the given operator and operands.

public static Yiisoft\Db\QueryBuilder\Condition\AbstractBetween fromArrayDefinition ( string $operator, array $operands )
$operator string
$operands array
throws InvalidArgumentException

If the number of operands isn't 3.

                final public static function fromArrayDefinition(string $operator, array $operands): static
{
    if (!isset($operands[0], $operands[1], $operands[2])) {
        throw new InvalidArgumentException("Operator '$operator' requires three operands.");
    }
    return new static(
        self::validateColumn($operator, $operands[0]),
        $operands[1],
        $operands[2],
    );
}