Skip to content

Commit e0a3cda

Browse files
committed
Small tweak
1 parent 6ec9573 commit e0a3cda

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Jenssegers/Mongodb/Model.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,9 @@ public function getTable()
221221
public function getAttribute($key)
222222
{
223223
// Check if the key is an array dot notation.
224-
if (str_contains($key, '.'))
224+
if (str_contains($key, '.') and array_has($this->attributes, $key))
225225
{
226-
$attributes = array_dot($this->attributes);
227-
228-
if (array_key_exists($key, $attributes))
229-
{
230-
return $this->getAttributeValue($key);
231-
}
226+
return $this->getAttributeValue($key);
232227
}
233228

234229
$camelKey = camel_case($key);

0 commit comments

Comments
 (0)