Skip to content

Commit 2a8423c

Browse files
committed
fix get propety not exist in collection
1 parent 2a9aaaa commit 2a8423c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Classes/ModelCollectionBase.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ public function __get($attribute)
4040
} else {
4141
$value = $this->attributeValues[$attribute] ?? null;
4242

43-
if (!$value) {
44-
return parent::__get($attribute);
43+
if (is_null($value)) {
44+
if (parent::has($attribute)) {
45+
return parent::__get($attribute);
46+
}
4547
}
4648

4749
return $value;

0 commit comments

Comments
 (0)