Final Class Yiisoft\Db\Pgsql\Expression\Int8RangeValue
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $includeLower | boolean | Yiisoft\ |
|
| $includeUpper | boolean | Yiisoft\ |
|
| $lower | int|string|null | Yiisoft\ |
|
| $upper | int|string|null | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| getBounds() | Returns the lower and upper bounds of a range, inclusive. | Yiisoft\ |
Property Details
Method Details
| 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,
) {}
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];
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.