[-] BO : remove sprintf() which are unnecessary
This commit is contained in:
@@ -86,11 +86,11 @@ class CustomerMessageCore extends ObjectModel
|
||||
FROM '._DB_PREFIX_.'customer_message
|
||||
');
|
||||
else
|
||||
return (int)Db::getInstance()->getValue(sprintf('
|
||||
return (int)Db::getInstance()->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM '._DB_PREFIX_.'customer_message
|
||||
WHERE %s
|
||||
', $where));
|
||||
WHERE '.$where
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -122,11 +122,11 @@ class CustomerThreadCore extends ObjectModel
|
||||
FROM '._DB_PREFIX_.'customer_thread
|
||||
');
|
||||
else
|
||||
return (int)Db::getInstance()->getValue(sprintf('
|
||||
return (int)Db::getInstance()->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM '._DB_PREFIX_.'customer_thread
|
||||
WHERE %s
|
||||
', $where));
|
||||
WHERE '.$where
|
||||
);
|
||||
}
|
||||
|
||||
public static function getMessageCustomerThreads($id_customer_thread)
|
||||
|
||||
@@ -294,12 +294,12 @@ class EmployeeCore extends ObjectModel
|
||||
|
||||
public static function getTotalEmployeeShopById($id)
|
||||
{
|
||||
return (int)Db::getInstance()->getValue(sprintf('SELECT COUNT(*) FROM`'._DB_PREFIX_.'employee_shop` WHERE `id_employee` = %d', (int)$id));
|
||||
return (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM`'._DB_PREFIX_.'employee_shop` WHERE `id_employee` = '.(int)$id);
|
||||
}
|
||||
|
||||
public static function getEmployeeShopById($id)
|
||||
{
|
||||
$result = Db::getInstance()->executeS(sprintf('SELECT * FROM`'._DB_PREFIX_.'employee_shop` WHERE `id_employee` = %d', (int)$id));
|
||||
$result = Db::getInstance()->executeS('SELECT * FROM`'._DB_PREFIX_.'employee_shop` WHERE `id_employee` = '.(int)$id);
|
||||
$data = array();
|
||||
foreach ($result as $group_data)
|
||||
$data[] = (int)$group_data['id_shop'];
|
||||
|
||||
@@ -101,7 +101,7 @@ class RequestSqlCore extends ObjectModel
|
||||
*/
|
||||
public static function getRequestSqlById($id)
|
||||
{
|
||||
return Db::getInstance()->executeS(sprintf('SELECT `sql` FROM `'._DB_PREFIX_.'request_sql` WHERE `id_request_sql` = %d', $id));
|
||||
return Db::getInstance()->executeS('SELECT `sql` FROM `'._DB_PREFIX_.'request_sql` WHERE `id_request_sql` = '.(int)$id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,7 +216,7 @@ class RequestSqlCore extends ObjectModel
|
||||
*/
|
||||
public function getAttributesByTable($table)
|
||||
{
|
||||
return Db::getInstance()->executeS(sprintf('DESCRIBE %s', $table));
|
||||
return Db::getInstance()->executeS('DESCRIBE '.pSQL($table));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -153,13 +153,7 @@ class GroupShopCore extends ObjectModel
|
||||
*/
|
||||
public static function getGroupShopById($id, $identifier, $table)
|
||||
{
|
||||
$sql = sprintf('
|
||||
SELECT `id_group_shop`, `%s`
|
||||
FROM `'._DB_PREFIX_.'%s_group_shop`
|
||||
WHERE `%s` = %d'
|
||||
, $identifier, $table, $identifier, $id);
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
return Db::getInstance()->executeS('SELECT `id_group_shop`, `'.pSQL($identifier).'` FROM `'._DB_PREFIX_.pSQL($table).'_group_shop` WHERE `'.pSQL($identifier).'` = '.(int)$id);
|
||||
}
|
||||
|
||||
public function copyGroupShopData($old_id, $tables_import = false, $deleted = false)
|
||||
|
||||
@@ -641,13 +641,7 @@ class ShopCore extends ObjectModel
|
||||
*/
|
||||
public static function getShopById($id, $identifier, $table)
|
||||
{
|
||||
$sql = sprintf('
|
||||
SELECT `id_shop`, `%s`
|
||||
FROM `'._DB_PREFIX_.'%s_shop`
|
||||
WHERE `%s` = %d',
|
||||
pSQL($identifier), pSQL($table), pSQL($identifier), $id);
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
return Db::getInstance()->executeS('SELECT `id_shop`, `'.pSQL($identifier).'` FROM `'._DB_PREFIX_.pSQL($table).'_shop` WHERE `'.pSQL($identifier).'` = '.(int)$id);
|
||||
}
|
||||
|
||||
public static function setContext($type, $id = null)
|
||||
|
||||
Reference in New Issue
Block a user