0

Final Class Yiisoft\Db\Pgsql\Expression\Int8RangeValue

InheritanceYiisoft\Db\Pgsql\Expression\Int8RangeValue
ImplementsYiisoft\Db\Expression\ExpressionInterface

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Db\Pgsql\Expression\Int8RangeValue
getBounds() Returns the lower and upper bounds of a range, inclusive. Yiisoft\Db\Pgsql\Expression\Int8RangeValue

Property Details

Hide inherited properties

$includeLower public property
public boolean $includeLower true
$includeUpper public property
public boolean $includeUpper true
$lower public property
public int|string|null $lower null
$upper public property
public int|string|null $upper null

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( integer|string|null $lower null, integer|string|null $upper null, boolean $includeLower true, boolean $includeUpper true )
$lower integer|string|null
$upper integer|string|null
$includeLower boolean
$includeUpper boolean

                public function __construct(
    public readonly int|string|null $lower = null,
    public readonly int|string|null $upper = null,
    public readonly bool $includeLower = true,
    public readonly bool $includeUpper = true,
) {}

            
getBounds() public method

Returns the lower and upper bounds of a range, inclusive.

public array getBounds ( )

                public function getBounds(): array
{
    $lower = $this->lower === null || $this->includeLower
        ? $this->lower
        : (
            PHP_INT_MIN < $this->lower && $this->lower < PHP_INT_MAX
            ? (int) $this->lower + 1
            : throw new RuntimeException(
                'Lower bound cannot be determined from the excluded value of a bigint range.',
            )
        );
    $upper = $this->upper === null || $this->includeUpper
        ? $this->upper
        : (
            PHP_INT_MIN < $this->upper && $this->upper < PHP_INT_MAX
            ? (int) $this->upper - 1
            : throw new RuntimeException(
                'Upper bound cannot be determined from the excluded value of a bigint range.',
            )
        );
    return [$lower, $upper];
}