0 follower

Final Class Yiisoft\Db\Pgsql\Expression\TsRangeValue

InheritanceYiisoft\Db\Pgsql\Expression\TsRangeValue
ImplementsYiisoft\Db\Expression\ExpressionInterface

Public Methods

Hide inherited methods

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

Property Details

Hide inherited properties

$includeLower public property
public boolean $includeLower true
$includeUpper public property
public boolean $includeUpper true
$lower public property
public ?\DateTimeImmutable $lower null
$upper public property
public ?\DateTimeImmutable $upper null

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( ?\DateTimeImmutable $lower null, ?\DateTimeImmutable $upper null, boolean $includeLower true, boolean $includeUpper true )
$lower ?\DateTimeImmutable
$upper ?\DateTimeImmutable
$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,
) {}

            
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
        : $this->lower->modify('+1 second');
    $upper = $this->upper === null || $this->includeUpper
        ? $this->upper
        : $this->upper->modify('-1 second');
    return [$lower, $upper];
}