Skip to content

Commit 3027abf

Browse files
mfos239darrylkuhn
authored andcommitted
Fix to get attribute directly, avoids calling an unnecessary and pote… (darrylkuhn#18)
* Fix to get attribute directly, avoids calling an unnecessary and potentially expensive magic method * Refactor for case of computed attribute
1 parent d749cdc commit 3027abf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Dialect/Json.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ public function inspectJsonColumns()
8282
if (!$this->showJsonColumns) {
8383
$this->hidden[] = $col;
8484
}
85-
$obj = json_decode($this->$col);
85+
86+
if(array_key_exists($col, $this->attributes)) {
87+
$obj = json_decode($this->attributes[$col]);
88+
}
89+
else {
90+
$obj = json_decode($this->$col);
91+
}
8692

8793
if (is_object($obj)) {
8894
foreach ($obj as $key => $value) {

0 commit comments

Comments
 (0)