[*] Classes: Remove $fieldsRequired, $fieldsSize and $fieldsValidate (and lang properties) properties, use $definition instead

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11155 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-12 18:10:38 +00:00
parent c97bac9160
commit fddf4fb89b
92 changed files with 1495 additions and 854 deletions
+13 -8
View File
@@ -37,20 +37,25 @@ class GroupShopCore extends ObjectModel
public $share_order;
public $deleted;
protected $fieldsSize = array('name' => 64);
protected $fieldsValidate = array(
'active' => 'isBool',
'share_customer' => 'isBool',
'share_order' => 'isBool',
'share_stock' => 'isBool',
'name' => 'isGenericName',
);
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'group_shop',
'primary' => 'id_group_shop',
'fields' => array(
'active' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'share_customer' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'share_order' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'share_stock' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'name' => array('type' => 'FILL_ME', 'validate' => 'isGenericName', 'size' => 64),
),
);
private static $assoTables = array(
'attribute_group' => array('type' => 'group_shop'),
'attribute' => array('type' => 'group_shop'),
+14 -6
View File
@@ -48,18 +48,26 @@ class ShopCore extends ObjectModel
*/
protected $group;
protected $fieldsRequired = array('id_theme', 'id_category', 'id_group_shop', 'name');
protected $fieldsSize = array('name' => 64);
protected $fieldsValidate = array(
'active' => 'isBool',
'name' => 'isGenericName',
);
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'shop',
'primary' => 'id_shop',
'fields' => array(
'active' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'name' => array('type' => 'FILL_ME', 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
'id_theme' => array('type' => 'FILL_ME', 'required' => true),
'id_category' => array('type' => 'FILL_ME', 'required' => true),
'id_group_shop' => array('type' => 'FILL_ME', 'required' => true),
),
);
/** @var array List of shops cached */
protected static $shops;
+14 -3
View File
@@ -38,15 +38,26 @@ class ShopUrlCore extends ObjectModel
private static $main_domain = null;
private static $main_domain_ssl = null;
protected $fieldsRequired = array('domain', 'id_shop');
protected $fieldsSize = array('domain' => 255, 'physical_uri' => 64, 'virtual_uri' => 64);
protected $fieldsValidate = array('active' => 'isBool');
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'shop_url',
'primary' => 'id_shop_url',
'fields' => array(
'active' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'domain' => array('type' => 'FILL_ME', 'required' => true, 'size' => 255),
'id_shop' => array('type' => 'FILL_ME', 'required' => true),
'physical_uri' => array('type' => 'FILL_ME', 'size' => 64),
'virtual_uri' => array('type' => 'FILL_ME', 'size' => 64),
),
);
public function getFields()
{
$this->validateFields();