When we call the method loadDefaultValues() from a Model the default value is always 0 even if in the table schema is set as 1 .
The problem is in the ColumnSchema::typecast() when we try to covert ((1)) to Integer it always converts it to 0 because of the parentheses.
protected function typecast($value)
{
...
case 'integer':
return (int) $value;
...
}
| Q | A
| ---------------- | ---
| Yii version | 2.0.13
| PHP version | 7.1
| Operating system | Windows Server
Most helpful comment
Fixed by https://github.com/yiisoft/yii2/pull/17420