From 3e00c5212863ec0572ce145d8a169ba32c6034d5 Mon Sep 17 00:00:00 2001 From: slawkens Date: Wed, 24 Jul 2024 17:30:03 +0200 Subject: [PATCH] Optimize OTS_House::load function with appropriate FETCH_ASSOC --- system/libs/pot/OTS_House.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/system/libs/pot/OTS_House.php b/system/libs/pot/OTS_House.php index 12a8f1cb..9ef0c149 100644 --- a/system/libs/pot/OTS_House.php +++ b/system/libs/pot/OTS_House.php @@ -60,12 +60,7 @@ class OTS_House extends OTS_Row_DAO private $tiles = array(); public function load($id) { - $this->data = $this->db->query('SELECT * FROM `houses` WHERE `id` = ' . $id )->fetch(); - foreach($this->data as $key => $value) { - if(is_numeric($key)) { - unset($this->data[$key]); - } - } + $this->data = $this->db->query('SELECT * FROM `houses` WHERE `id` = ' . $id )->fetch(PDO::FETCH_ASSOC); } public function find($name)