Skip to content

Commit

Permalink
Merge pull request #4 from jordan314/master
Browse files Browse the repository at this point in the history
Array instead of Object for Issue 3
  • Loading branch information
friedolinfoerder committed Dec 20, 2017
2 parents 16e5058 + 6a1cfab commit e4ee8c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public function get() {
}

$modelClass = $this->model;
$results = static::wpdb()->get_results($this->sql(), OBJECT_K);
$results = static::wpdb()->get_results($this->sql(), ARRAY_A);
$models = [];
foreach($results as $result) {
$models[] = new $modelClass($result);
Expand All @@ -529,7 +529,7 @@ public function get_one() {
}

$modelClass = $this->model;
$result = static::wpdb()->get_row($this->sql(), OBJECT_K);
$result = static::wpdb()->get_row($this->sql(), ARRAY_A);
return new $modelClass($result);
}

Expand Down

0 comments on commit e4ee8c0

Please sign in to comment.