0 follower

Final Class Yiisoft\Db\Pgsql\Expression\NumRangeValue

InheritanceYiisoft\Db\Pgsql\Expression\NumRangeValue
ImplementsYiisoft\Db\Expression\ExpressionInterface

Public Methods

Hide inherited methods

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

Property Details

Hide inherited properties

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

Method Details

Hide inherited methods

__construct() public method

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

                public function __construct(
    public readonly int|float|null $lower = null,
    public readonly int|float|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
        : throw new RuntimeException(
            'Lower bound cannot be determined from the excluded value of a numeric range.',
        );
    $upper = $this->upper === null || $this->includeUpper
        ? $this->upper
        : throw new RuntimeException(
            'Upper bound cannot be determined from the excluded value of a numeric range.',
        );
    return [$lower, $upper];
}