Final Class Yiisoft\Db\Pgsql\Column\Int8RangeColumn
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| dbTypecast() | Yiisoft\ |
|
| phpTypecast() | Yiisoft\ |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| createRangeValue() | Yiisoft\ |
|
| getBoundColumn() | Yiisoft\ |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| DEFAULT_TYPE | \ |
Yiisoft\ |
Method Details
| protected Yiisoft\ | ||
| $lower | ?string | |
| $upper | ?string | |
| $includeLower | boolean | |
| $includeUpper | boolean | |
protected function createRangeValue(?string $lower, ?string $upper, bool $includeLower, bool $includeUpper): Int8RangeValue
{
$column = $this->getBoundColumn();
return new Int8RangeValue(
$column->phpTypecast($lower),
$column->phpTypecast($upper),
$includeLower,
$includeUpper,
);
}
| public string|\ | ||
| $value | mixed | |
public function dbTypecast(mixed $value): mixed
{
if ($value === null
|| is_string($value)
|| $value instanceof ExpressionInterface) {
return $value;
}
if (!is_array($value)) {
$this->throwWrongTypeException(gettype($value));
}
if (array_keys($value) !== [0, 1]) {
throw new InvalidArgumentException(
'Value of range should be an array with two elements: lower and upper bounds.',
);
}
[$lower, $upper] = $value;
$boundColumn = $this->getBoundColumn();
return '['
. $this->prepareBoundValue($boundColumn->dbTypecast($lower))
. ','
. $this->prepareBoundValue($boundColumn->dbTypecast($upper))
. ']';
}
| protected \ |
protected function getBoundColumn(): BigIntColumn|IntegerColumn
{
return RangeBoundColumnFactory::int8();
}
| public ?\ | ||
| $value | mixed | |
public function phpTypecast(mixed $value): ?Int8RangeValue
{
return parent::phpTypecast($value);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.