Final Class Yiisoft\Db\Pgsql\Expression\NumRangeValue
| Inheritance | Yiisoft\Db\Pgsql\Expression\NumRangeValue |
|---|---|
| Implements | Yiisoft\Db\Expression\ExpressionInterface |
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $includeLower | boolean | Yiisoft\Db\Pgsql\Expression\NumRangeValue | |
| $includeUpper | boolean | Yiisoft\Db\Pgsql\Expression\NumRangeValue | |
| $lower | int|float|null | Yiisoft\Db\Pgsql\Expression\NumRangeValue | |
| $upper | int|float|null | Yiisoft\Db\Pgsql\Expression\NumRangeValue |
Public 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
Method Details
| 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,
) {}
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];
}
Signup or Login in order to comment.