Skip to content

Commit

Permalink
Convert StdClass to object
Browse files Browse the repository at this point in the history
  • Loading branch information
emagombe authored Sep 18, 2020
1 parent 80a8a18 commit 4e5135b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public function build() {
public function addColumn($column_name, $callback) {
$result = [];
foreach($this->db_result as $index => $row) {
$row = (array) $row;
$row[$column_name] = $callback($row);
$result[] = $row;
}
Expand Down Expand Up @@ -179,6 +180,7 @@ private function sort($result) {
$order_column_array = [];
foreach($result as $key => $value) {
/* If it's the order column */
$value = (array) $value;
$order_column_array[] = $value[$order_column_name];
}

Expand Down Expand Up @@ -227,4 +229,4 @@ private function search($result) {
}
return $filtered_result;
}
}
}

0 comments on commit 4e5135b

Please sign in to comment.