Skip to content

Commit

Permalink
Fixed issue with ::get() response when object isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
lux committed Jan 22, 2024
1 parent a1cbdda commit 01a65c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public function remove ($id = false) {
public static function get ($id) {
$class = get_called_class ();
$q = new $class;
$res = (array) DB::single ('select * from `' . $q->table . '` where `' . $q->key . '` = ?', $id);
$res = DB::single ('select * from `' . $q->table . '` where `' . $q->key . '` = ?', $id);
if (! $res) {
$q->error = (DB::$error != false) ? DB::error () : 'No object by that ID.';
$q->data = array ();
Expand Down

0 comments on commit 01a65c9

Please sign in to comment.