Skip to content

Commit af42311

Browse files
authored
Mini fixes (#220)
1 parent 03291d9 commit af42311

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ActiveRecord.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ public function isTransactional(int $operation): array|bool
243243
public function loadDefaultValues(bool $skipIfSet = true): self
244244
{
245245
foreach ($this->getTableSchema()->getColumns() as $column) {
246-
if ($column->getDefaultValue() !== null && (!$skipIfSet || $this->{$column->getName()} === null)) {
247-
$this->{$column->getName()} = $column->getDefaultValue();
246+
if ($column->getDefaultValue() !== null && (!$skipIfSet || $this->getAttribute($column->getName()) === null)) {
247+
$this->setAttribute($column->getName(), $column->getDefaultValue());
248248
}
249249
}
250250

0 commit comments

Comments
 (0)