We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03291d9 commit af42311Copy full SHA for af42311
1 file changed
src/ActiveRecord.php
@@ -243,8 +243,8 @@ public function isTransactional(int $operation): array|bool
243
public function loadDefaultValues(bool $skipIfSet = true): self
244
{
245
foreach ($this->getTableSchema()->getColumns() as $column) {
246
- if ($column->getDefaultValue() !== null && (!$skipIfSet || $this->{$column->getName()} === null)) {
247
- $this->{$column->getName()} = $column->getDefaultValue();
+ if ($column->getDefaultValue() !== null && (!$skipIfSet || $this->getAttribute($column->getName()) === null)) {
+ $this->setAttribute($column->getName(), $column->getDefaultValue());
248
}
249
250
0 commit comments