// Removed useless bit of code (retrieval of the manufacturer address in the constructor, 1 query each time, no use)
This commit is contained in:
@@ -103,8 +103,6 @@ class ManufacturerCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
parent::__construct($id, $id_lang);
|
parent::__construct($id, $id_lang);
|
||||||
|
|
||||||
/* Get the manufacturer's id_address */
|
|
||||||
$this->id_address = $this->getManufacturerAddress();
|
|
||||||
$this->link_rewrite = $this->getLink();
|
$this->link_rewrite = $this->getLink();
|
||||||
$this->image_dir = _PS_MANU_IMG_DIR_;
|
$this->image_dir = _PS_MANU_IMG_DIR_;
|
||||||
}
|
}
|
||||||
@@ -149,16 +147,7 @@ class ManufacturerCore extends ObjectModel
|
|||||||
if (!(int)$this->id)
|
if (!(int)$this->id)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$result = Db::GetInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_address` FROM '._DB_PREFIX_.'address WHERE `id_manufacturer` = '.(int)$this->id);
|
||||||
SELECT `id_address`
|
|
||||||
FROM '._DB_PREFIX_.'address
|
|
||||||
WHERE `id_manufacturer` = '.(int)$this->id
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!$result)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return $result['id_address'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user