Final Class Yiisoft\Db\Pgsql\Expression\DateRangeValue
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $includeLower | boolean | Yiisoft\ |
|
| $includeUpper | boolean | Yiisoft\ |
|
| $lower | ?\ |
Yiisoft\ |
|
| $upper | ?\ |
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 ( ?\ | ||
| $lower | ?\ |
|
| $upper | ?\ |
|
| $includeLower | boolean | |
| $includeUpper | boolean | |
public function __construct(
public readonly ?DateTimeImmutable $lower = null,
public readonly ?DateTimeImmutable $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
: $this->lower->modify('+1 day');
$upper = $this->upper === null || $this->includeUpper
? $this->upper
: $this->upper->modify('-1 day');
return [$lower, $upper];
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.