Final Class Yiisoft\Db\Oracle\Column\BooleanColumn
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| dbTypecast() | Yiisoft\ |
|
| phpTypecast() | Yiisoft\ |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| DEFAULT_TYPE | \ |
Yiisoft\ |
Method Details
| public string|\ | ||
| $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'),
};
}
| public ?bool phpTypecast ( mixed $value ) | ||
| $value | mixed | |
public function phpTypecast(mixed $value): ?bool
{
if ($value === null) {
return null;
}
return $value && $value !== "\0";
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.