// Normalize
This commit is contained in:
1 parent
3a884afaea
commit
65dbff3789
1 file changed
+6
-8
+6
-8
@@ -33,9 +33,6 @@ class ZoneCore extends ObjectModel
|
|||||||
/** @var boolean Zone status */
|
/** @var boolean Zone status */
|
||||||
public $active = true;
|
public $active = true;
|
||||||
|
|
||||||
/* @todo Obsolete; to remove */
|
|
||||||
public $eu_zone = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ObjectModel::$definition
|
* @see ObjectModel::$definition
|
||||||
*/
|
*/
|
||||||
@@ -48,7 +45,6 @@ class ZoneCore extends ObjectModel
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
protected $webserviceParameters = array();
|
protected $webserviceParameters = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,7 +59,8 @@ class ZoneCore extends ObjectModel
|
|||||||
SELECT *
|
SELECT *
|
||||||
FROM `'._DB_PREFIX_.'zone`
|
FROM `'._DB_PREFIX_.'zone`
|
||||||
'.($active ? 'WHERE active = 1' : '').'
|
'.($active ? 'WHERE active = 1' : '').'
|
||||||
ORDER BY `name` ASC');
|
ORDER BY `name` ASC
|
||||||
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,7 +74,8 @@ class ZoneCore extends ObjectModel
|
|||||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||||
SELECT `id_zone`
|
SELECT `id_zone`
|
||||||
FROM `'._DB_PREFIX_.'zone`
|
FROM `'._DB_PREFIX_.'zone`
|
||||||
WHERE `name` = \''.pSQL($name).'\'');
|
WHERE `name` = \''.pSQL($name).'\'
|
||||||
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,11 +87,11 @@ class ZoneCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
if (parent::delete())
|
if (parent::delete())
|
||||||
{
|
{
|
||||||
/* Delete regarding delivery preferences */
|
// Delete regarding delivery preferences
|
||||||
$result = Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_zone WHERE id_zone = '.(int)$this->id);
|
$result = Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_zone WHERE id_zone = '.(int)$this->id);
|
||||||
$result &= Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'delivery WHERE id_zone = '.(int)$this->id);
|
$result &= Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'delivery WHERE id_zone = '.(int)$this->id);
|
||||||
|
|
||||||
/* Update Country & state zone with 0 */
|
// Update Country & state zone with 0
|
||||||
$result &= Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'country SET id_zone = 0 WHERE id_zone = '.(int)$this->id);
|
$result &= Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'country SET id_zone = 0 WHERE id_zone = '.(int)$this->id);
|
||||||
$result &= Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'state SET id_zone = 0 WHERE id_zone = '.(int)$this->id);
|
$result &= Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'state SET id_zone = 0 WHERE id_zone = '.(int)$this->id);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user