0 follower

Final Class Yiisoft\Db\Oracle\Column\BooleanColumn

InheritanceYiisoft\Db\Oracle\Column\BooleanColumn » Yiisoft\Db\Schema\Column\AbstractColumn

Constants

Hide inherited constants

Constant Value Description Defined By
DEFAULT_TYPE \Yiisoft\Db\Constant\ColumnType::BOOLEAN Yiisoft\Db\Oracle\Column\BooleanColumn

Method Details

Hide inherited methods

dbTypecast() public method

public string|\Yiisoft\Db\Expression\ExpressionInterface|null dbTypecast ( mixed $value )
$value mixed

                public function dbTypecast(mixed $value): string|ExpressionInterface|null
{
    return match ($value) {
        true => '1',
        false => '0',
        null, '' => null,
        default => $value instanceof ExpressionInterface ? $value : ($value ? '1' : '0'),
    };
}

            
phpTypecast() public method

public boolean|null phpTypecast ( mixed $value )
$value mixed

                public function phpTypecast(mixed $value): ?bool
{
    if ($value === null) {
        return null;
    }
    return $value && $value !== "\0";
}