// Format definitions
This commit is contained in:
+14
-24
@@ -32,11 +32,9 @@ class ZoneCore extends ObjectModel
|
||||
|
||||
/** @var boolean Zone status */
|
||||
public $active = true;
|
||||
public $eu_zone = false; /* Obsolete; to remove */
|
||||
|
||||
|
||||
|
||||
|
||||
/* @todo Obsolete; to remove */
|
||||
public $eu_zone = false;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
@@ -45,29 +43,20 @@ class ZoneCore extends ObjectModel
|
||||
'table' => 'zone',
|
||||
'primary' => 'id_zone',
|
||||
'fields' => array(
|
||||
'name' => array('type' => 'FILL_ME', 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||
'active' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
protected $webserviceParameters = array();
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
$fields['name'] = pSQL($this->name);
|
||||
$fields['active'] = (int)$this->active;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all available geographical zones
|
||||
*
|
||||
* @return array Zones
|
||||
*/
|
||||
* Get all available geographical zones
|
||||
*
|
||||
* @param bool $active
|
||||
* @return array Zones
|
||||
*/
|
||||
public static function getZones($active = false)
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
@@ -78,10 +67,11 @@ class ZoneCore extends ObjectModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a zone ID from its default language name
|
||||
*
|
||||
* @return integer id_zone
|
||||
*/
|
||||
* Get a zone ID from its default language name
|
||||
*
|
||||
* @param string $name
|
||||
* @return integer id_zone
|
||||
*/
|
||||
public static function getIdByName($name)
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
|
||||
Reference in New Issue
Block a user