Browse Source

fixup! src: Make inventory only fetch one item

master
Elis Hirwing 3 years ago
parent
commit
d0fd03163d
Signed by: etu GPG Key ID: D57EFA625C9A925F
  1. 4
      src/Etu/Helpers/Inventory.php

4
src/Etu/Helpers/Inventory.php

@ -13,7 +13,7 @@ class Inventory
$this->db = $db;
}
public function get(string $name) : \stdClass
public function get(string $name) : ?\stdClass
{
// Prepare query
$stmt = $this->db->prepare('SELECT * FROM inventory WHERE item_name = :item_name');
@ -24,6 +24,6 @@ class Inventory
// Execute and fetch result
$stmt->execute();
return $stmt->fetch() ?? ((object) []);
return $stmt->fetch();
}
}

Loading…
Cancel
Save