Skip to content

Commit

Permalink
Cache data in getInstanceData
Browse files Browse the repository at this point in the history
  • Loading branch information
driusan committed Jul 27, 2020
1 parent 27a5595 commit da89089
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions php/libraries/NDB_BVL_Instrument.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2144,14 +2144,15 @@ abstract class NDB_BVL_Instrument extends NDB_Page
"SELECT Data FROM flag WHERE CommentID=:CID",
['CID' => $this->getCommentID()]
);
return json_decode($jsondata, true) ?? [];
$this->instanceData = json_decode($jsondata, true) ?? [];
} else {
$defaults = $db->pselectRow(
"SELECT * FROM $this->table WHERE CommentID=:CID",
['CID' => $this->getCommentID()]
);
return $defaults ?? [];
$this->instanceData = $defaults ?? [];
}
return $this->instanceData;
}

/**
Expand Down

0 comments on commit da89089

Please sign in to comment.