Skip to content

Commit 7bb416b

Browse files
Merge pull request #13 from mgcostaParedes/ISSUE-12
fix: ISSUE-12 - now will set property of the model dynamically without context of the model class
2 parents 3c615dc + 11110c8 commit 7bb416b

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/Spanner/Traits/ModelAttributes.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,8 @@ public function getAttributes(): array
2626

2727
public function setRawAttributes(array $attributes): void
2828
{
29-
$reflect = new ReflectionObject($this);
30-
$props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
3129
foreach ($attributes as $key => $attribute) {
32-
$exists = array_filter($props, function ($prop) use ($key) {
33-
return $prop->name == $key && $prop->class == get_called_class();
34-
});
35-
if (!empty($exists)) {
36-
$this->{$key} = $attribute;
37-
}
30+
$this->{$key} = $attribute;
3831
}
3932
}
4033
}

0 commit comments

Comments
 (0)