From e1e434ebe1ddf194dc71d8ded42f28622fcce0c6 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Tue, 14 Aug 2012 14:26:40 +0000 Subject: [PATCH] // Removed useless bit of code (retrieval of the manufacturer address in the constructor, 1 query each time, no use) --- classes/Manufacturer.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/classes/Manufacturer.php b/classes/Manufacturer.php index 1c927ed33..232d8d1ac 100644 --- a/classes/Manufacturer.php +++ b/classes/Manufacturer.php @@ -103,8 +103,6 @@ class ManufacturerCore extends ObjectModel { parent::__construct($id, $id_lang); - /* Get the manufacturer's id_address */ - $this->id_address = $this->getManufacturerAddress(); $this->link_rewrite = $this->getLink(); $this->image_dir = _PS_MANU_IMG_DIR_; } @@ -149,16 +147,7 @@ class ManufacturerCore extends ObjectModel if (!(int)$this->id) return false; - $result = Db::GetInstance(_PS_USE_SQL_SLAVE_)->getRow(' - SELECT `id_address` - FROM '._DB_PREFIX_.'address - WHERE `id_manufacturer` = '.(int)$this->id - ); - - if (!$result) - return false; - - return $result['id_address']; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_address` FROM '._DB_PREFIX_.'address WHERE `id_manufacturer` = '.(int)$this->id); } /**