// Remove $table and $identifier property from all classes, and add static $definition instead

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10912 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-05 13:56:03 +00:00
parent 05ceb6ea96
commit 86683a963e
87 changed files with 394 additions and 214 deletions
+5 -2
View File
@@ -107,8 +107,11 @@ class AddressCore extends ObjectModel
'city' => 'isCityName', 'other' => 'isMessage', 'city' => 'isCityName', 'other' => 'isMessage',
'phone' => 'isPhoneNumber', 'phone_mobile' => 'isPhoneNumber', 'deleted' => 'isBool', 'dni' => 'isDniLite'); 'phone' => 'isPhoneNumber', 'phone_mobile' => 'isPhoneNumber', 'deleted' => 'isBool', 'dni' => 'isDniLite');
protected $table = 'address'; public static $definition = array(
protected $identifier = 'id_address'; 'table' => 'address',
'primary' => 'id_address',
);
protected $_includeVars = array('addressType' => 'table'); protected $_includeVars = array('addressType' => 'table');
protected $_includeContainer = false; protected $_includeContainer = false;
+4 -2
View File
@@ -42,8 +42,10 @@ class AddressFormatCore extends ObjectModel
protected $fieldsValidate = array ('format' => 'isGenericName'); protected $fieldsValidate = array ('format' => 'isGenericName');
/* MySQL does not allow 'order detail' for a table name */ /* MySQL does not allow 'order detail' for a table name */
protected $table = 'address_format'; public static $definition = array(
protected $identifier = 'id_country'; 'table' => 'address_format',
'primary' => 'id_country',
);
public static $requireFormFieldsList = array( public static $requireFormFieldsList = array(
'firstname', 'firstname',
+4 -2
View File
@@ -35,8 +35,10 @@ class AliasCore extends ObjectModel
protected $fieldsSize = array('alias' => 255, 'search' => 255); protected $fieldsSize = array('alias' => 255, 'search' => 255);
protected $fieldsValidate = array('search' => 'isValidSearch', 'alias' => 'isValidSearch', 'active' => 'isBool'); protected $fieldsValidate = array('search' => 'isValidSearch', 'alias' => 'isValidSearch', 'active' => 'isBool');
protected $table = 'alias'; public static $definition = array(
protected $identifier = 'id_alias'; 'table' => 'alias',
'primary' => 'id_alias',
);
function __construct($id = NULL, $alias = NULL, $search = NULL, $id_lang = NULL) function __construct($id = NULL, $alias = NULL, $search = NULL, $id_lang = NULL)
{ {
+5 -2
View File
@@ -44,8 +44,11 @@ class AttachmentCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 32); protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName', 'description' => 'isCleanHtml'); protected $fieldsValidateLang = array('name' => 'isGenericName', 'description' => 'isCleanHtml');
protected $table = 'attachment'; public static $definition = array(
protected $identifier = 'id_attachment'; 'table' => 'attachment',
'primary' => 'id_attachment',
'multilang' => true,
);
public function getFields() public function getFields()
{ {
+6 -2
View File
@@ -42,8 +42,12 @@ class AttributeCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 64); protected $fieldsSizeLang = array('name' => 64);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'attribute'; public static $definition = array(
protected $identifier = 'id_attribute'; 'table' => 'attribute',
'primary' => 'id_attribute',
'multilang' => true,
);
protected $image_dir = _PS_COL_IMG_DIR_; protected $image_dir = _PS_COL_IMG_DIR_;
protected $webserviceParameters = array( protected $webserviceParameters = array(
+5 -2
View File
@@ -42,8 +42,11 @@ class AttributeGroupCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 64, 'public_name' => 64); protected $fieldsSizeLang = array('name' => 64, 'public_name' => 64);
protected $fieldsValidateLang = array('name' => 'isGenericName', 'public_name' => 'isGenericName', 'position' => 'isInt'); protected $fieldsValidateLang = array('name' => 'isGenericName', 'public_name' => 'isGenericName', 'position' => 'isInt');
protected $table = 'attribute_group'; public static $definition = array(
protected $identifier = 'id_attribute_group'; 'table' => 'attribute_group',
'primary' => 'id_attribute_group',
'multilang' => true,
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectsNodeName' => 'product_options', 'objectsNodeName' => 'product_options',
+5 -2
View File
@@ -42,8 +42,11 @@ class CMSCore extends ObjectModel
protected $fieldsSizeLang = array('meta_description' => 255, 'meta_keywords' => 255, 'meta_title' => 128, 'link_rewrite' => 128, 'content' => 3999999999999); protected $fieldsSizeLang = array('meta_description' => 255, 'meta_keywords' => 255, 'meta_title' => 128, 'link_rewrite' => 128, 'content' => 3999999999999);
protected $fieldsValidateLang = array('meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName', 'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'content' => 'isString'); protected $fieldsValidateLang = array('meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName', 'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'content' => 'isString');
protected $table = 'cms'; public static $definition = array(
protected $identifier = 'id_cms'; 'table' => 'cms',
'primary' => 'id_cms',
'multilang' => true,
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectNodeName' => 'content', 'objectNodeName' => 'content',
+5 -2
View File
@@ -81,8 +81,11 @@ class CMSCategoryCore extends ObjectModel
protected $fieldsValidateLang = array('name' => 'isCatalogName', 'link_rewrite' => 'isLinkRewrite', 'description' => 'isCleanHtml', protected $fieldsValidateLang = array('name' => 'isCatalogName', 'link_rewrite' => 'isLinkRewrite', 'description' => 'isCleanHtml',
'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName'); 'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName');
protected $table = 'cms_category'; public static $definition = array(
protected $identifier = 'id_cms_category'; 'table' => 'cms_category',
'primary' => 'id_cms_category',
'multilang' => true,
);
public function __construct($id_cms_category = NULL, $id_lang = NULL) public function __construct($id_cms_category = NULL, $id_lang = NULL)
{ {
+5 -2
View File
@@ -122,8 +122,11 @@ class CarrierCore extends ObjectModel
protected $fieldsSizeLang = array('delay' => 128); protected $fieldsSizeLang = array('delay' => 128);
protected $fieldsValidateLang = array('delay' => 'isGenericName'); protected $fieldsValidateLang = array('delay' => 'isGenericName');
protected $table = 'carrier'; public static $definition = array(
protected $identifier = 'id_carrier'; 'table' => 'carrier',
'primary' => 'id_carrier',
'multilang' => true,
);
protected static $price_by_weight = array(); protected static $price_by_weight = array();
protected static $price_by_weight2 = array(); protected static $price_by_weight2 = array();
+5 -2
View File
@@ -105,8 +105,11 @@ class CartCore extends ObjectModel
protected static $_carriers = null; protected static $_carriers = null;
protected static $_taxes_rate = null; protected static $_taxes_rate = null;
protected static $_attributesLists = array(); protected static $_attributesLists = array();
protected $table = 'cart';
protected $identifier = 'id_cart'; public static $definition = array(
'table' => 'cart',
'primary' => 'id_cart',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+2 -1
View File
@@ -59,7 +59,8 @@ class CartRuleCore extends ObjectModel
public static $definition = array( public static $definition = array(
'table' => 'cart_rule', 'table' => 'cart_rule',
'primary' => 'id_cart_rule', 'identifier' => 'id_cart_rule',
'multilang' => true,
); );
protected $fieldsRequired = array('date_from', 'date_to'); protected $fieldsRequired = array('date_from', 'date_to');
+16 -11
View File
@@ -103,8 +103,11 @@ class CategoryCore extends ObjectModel
'meta_keywords' => 'isGenericName' 'meta_keywords' => 'isGenericName'
); );
protected $table = 'category'; public static $definition = array(
protected $identifier = 'id_category'; 'table' => 'category',
'primary' => 'id_category',
'multilang' => true,
);
/** @var string id_image is the category ID when an image exists and 'default' otherwise */ /** @var string id_image is the category ID when an image exists and 'default' otherwise */
public $id_image = 'default'; public $id_image = 'default';
@@ -703,18 +706,20 @@ class CategoryCore extends ObjectModel
ORDER BY `position` ASC'); ORDER BY `position` ASC');
} }
/** return an array of all children of the current category /**
* Return an array of all children of the current category
* *
* @return array rows of table category * @param int $id_lang
* @todo return hydrateCollection * @return Collection
*/ */
public function getAllChildren() public function getAllChildren($id_lang = null)
{ {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' if (is_null($id_lang))
SELECT * $id_lang = Context::getContext()->language->id;
FROM `'._DB_PREFIX_.'category`
WHERE '.(int)$this->nleft.' < nleft AND nright < '.(int)$this->nright $categories = new Collection('Category', $id_lang);
); $categories->where((int)$this->nleft.' < nleft AND nright < '.(int)$this->nright);
return $categories;
} }
/** /**
+3 -1
View File
@@ -78,7 +78,9 @@ class CollectionCore implements Iterator, Countable
$this->definition = ObjectModel::getDefinition($this->classname); $this->definition = ObjectModel::getDefinition($this->classname);
if (!isset($this->definition['table'])) if (!isset($this->definition['table']))
throw new PrestashopException('Miss table in definition'); throw new PrestashopException('Miss table in definition for class '.$this->classname);
else if (!isset($this->definition['primary']))
throw new PrestashopException('Miss primary in definition for class '.$this->classname);
$this->query = new DbQuery(); $this->query = new DbQuery();
$this->query->select('a.*'); $this->query->select('a.*');
+4 -2
View File
@@ -81,8 +81,10 @@ class CombinationCore extends ObjectModel
'available_date' => 'isDateFormat', 'available_date' => 'isDateFormat',
); );
protected $table = 'product_attribute'; public static $definition = array(
protected $identifier = 'id_product_attribute'; 'table' => 'product_attribute',
'primary' => 'id_product_attribute',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectNodeName' => 'combination', 'objectNodeName' => 'combination',
+4 -4
View File
@@ -44,10 +44,10 @@ class CompareProductCore extends ObjectModel
'id_customer' => 'isUnsignedInt' 'id_customer' => 'isUnsignedInt'
); );
protected $table = 'compare'; public static $definition = array(
'table' => 'compare',
protected $identifier = 'id_compare'; 'primary' => 'id_compare',
);
/** /**
* Get all comapare products of the customer * Get all comapare products of the customer
+5 -2
View File
@@ -48,8 +48,11 @@ class ConfigurationCore extends ObjectModel
protected $fieldsSize = array('name' => 32); protected $fieldsSize = array('name' => 32);
protected $fieldsValidate = array('name' => 'isConfigName', 'id_group_shop' => 'isUnsignedId', 'id_shop' => 'isUnsignedId'); protected $fieldsValidate = array('name' => 'isConfigName', 'id_group_shop' => 'isUnsignedId', 'id_shop' => 'isUnsignedId');
protected $table = 'configuration'; public static $definition = array(
protected $identifier = 'id_configuration'; 'table' => 'configuration',
'primary' => 'id_configuration',
'multilang' => true,
);
/** @var array Configuration cache */ /** @var array Configuration cache */
protected static $_CONF; protected static $_CONF;
+4 -2
View File
@@ -53,8 +53,10 @@ class ConnectionCore extends ObjectModel
'ip_address' => 'isInt', 'http_referer' => 'isAbsoluteUrl'); 'ip_address' => 'isInt', 'http_referer' => 'isAbsoluteUrl');
/* MySQL does not allow 'connection' for a table name */ /* MySQL does not allow 'connection' for a table name */
protected $table = 'connections'; public static $definition = array(
protected $identifier = 'id_connections'; 'table' => 'connections',
'primary' => 'id_connections',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -38,8 +38,10 @@ class ConnectionsSourceCore extends ObjectModel
protected $fieldsRequired = array('id_connections', 'date_add'); protected $fieldsRequired = array('id_connections', 'date_add');
protected $fieldsValidate = array('id_connections' => 'isUnsignedId', 'http_referer' => 'isAbsoluteUrl', 'request_uri' => 'isUrl', 'keywords' => 'isMessage'); protected $fieldsValidate = array('id_connections' => 'isUnsignedId', 'http_referer' => 'isAbsoluteUrl', 'request_uri' => 'isUrl', 'keywords' => 'isMessage');
protected $table = 'connections_source'; public static $definition = array(
protected $identifier = 'id_connections_source'; 'table' => 'connections_source',
'primary' => 'id_connections_source',
);
public function getFields() public function getFields()
{ {
+5 -2
View File
@@ -47,8 +47,11 @@ class ContactCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 32); protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName', 'description' => 'isCleanHtml'); protected $fieldsValidateLang = array('name' => 'isGenericName', 'description' => 'isCleanHtml');
protected $table = 'contact'; public static $definition = array(
protected $identifier = 'id_contact'; 'table' => 'contact',
'primary' => 'id_contact',
'multilang' => true,
);
public function getFields() public function getFields()
{ {
+5 -2
View File
@@ -93,8 +93,11 @@ class CountryCore extends ObjectModel
), ),
); );
protected $table = 'country'; public static $definition = array(
protected $identifier = 'id_country'; 'table' => 'country',
'primary' => 'id_country',
'multilang' => true,
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -40,8 +40,10 @@ class CountyCore extends ObjectModel
protected $fieldsSize = array('name' => 64); protected $fieldsSize = array('name' => 64);
protected $fieldsValidate = array('name' => 'isGenericName', 'id_state' => 'isUnsignedId', 'active' => 'isBool'); protected $fieldsValidate = array('name' => 'isGenericName', 'id_state' => 'isUnsignedId', 'active' => 'isBool');
protected $table = 'county'; public static $definition = array(
protected $identifier = 'id_county'; 'table' => 'county',
'primary' => 'id_county',
);
private static $_cache_get_counties = array(); private static $_cache_get_counties = array();
private static $_cache_county_zipcode = array(); private static $_cache_county_zipcode = array();
+5 -2
View File
@@ -64,8 +64,11 @@ class CurrencyCore extends ObjectModel
protected $fieldsValidate = array('name' => 'isGenericName', 'iso_code' => 'isLanguageIsoCode', 'iso_code_num' => 'isNumericIsoCode', 'blank' => 'isInt', 'sign' => 'isGenericName', protected $fieldsValidate = array('name' => 'isGenericName', 'iso_code' => 'isLanguageIsoCode', 'iso_code_num' => 'isNumericIsoCode', 'blank' => 'isInt', 'sign' => 'isGenericName',
'format' => 'isUnsignedId', 'decimals' => 'isBool', 'conversion_rate' => 'isFloat', 'deleted' => 'isBool', 'active' => 'isBool'); 'format' => 'isUnsignedId', 'decimals' => 'isBool', 'conversion_rate' => 'isFloat', 'deleted' => 'isBool', 'active' => 'isBool');
protected $table = 'currency'; public static $definition = array(
protected $identifier = 'id_currency'; 'table' => 'currency',
'primary' => 'id_currency',
'multilang' => true,
);
/** @var array Currency cache */ /** @var array Currency cache */
static protected $currencies = array(); static protected $currencies = array();
+4 -2
View File
@@ -142,8 +142,10 @@ class CustomerCore extends ObjectModel
), ),
); );
protected $table = 'customer'; public static $definition = array(
protected $identifier = 'id_customer'; 'table' => 'customer',
'primary' => 'id_customer',
);
protected static $_defaultGroupId = array(); protected static $_defaultGroupId = array();
protected static $_customerHasAddress = array(); protected static $_customerHasAddress = array();
+4 -2
View File
@@ -37,8 +37,10 @@ class CustomerMessageCore extends ObjectModel
public $private; public $private;
public $date_add; public $date_add;
protected $table = 'customer_message'; public static $definition = array(
protected $identifier = 'id_customer_message'; 'table' => 'customer_message',
'primary' => 'id_customer_message',
);
protected $fieldsRequired = array('message'); protected $fieldsRequired = array('message');
protected $fieldsSize = array('message' => 65000); protected $fieldsSize = array('message' => 65000);
+4 -2
View File
@@ -40,8 +40,10 @@ class CustomerThreadCore extends ObjectModel
public $date_add; public $date_add;
public $date_upd; public $date_upd;
protected $table = 'customer_thread'; public static $definition = array(
protected $identifier = 'id_customer_thread'; 'table' => 'customer_thread',
'primary' => 'id_customer_thread',
);
protected $fieldsRequired = array('id_lang', 'id_contact', 'token'); protected $fieldsRequired = array('id_lang', 'id_contact', 'token');
protected $fieldsSize = array('email' => 254); protected $fieldsSize = array('email' => 254);
+4 -2
View File
@@ -33,8 +33,10 @@ class DateRangeCore extends ObjectModel
protected $fieldsRequired = array ('time_start', 'time_end'); protected $fieldsRequired = array ('time_start', 'time_end');
protected $fieldsValidate = array ('time_start' => 'isDate', 'time_end' => 'isDate'); protected $fieldsValidate = array ('time_start' => 'isDate', 'time_end' => 'isDate');
protected $table = 'date_range'; public static $definition = array(
protected $identifier = 'id_date_range'; 'table' => 'date_range',
'primary' => 'id_date_range',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -67,8 +67,10 @@ class DeliveryCore extends ObjectModel
'price' => 'isPrice' 'price' => 'isPrice'
); );
protected $table = 'delivery'; public static $definition = array(
protected $identifier = 'id_delivery'; 'table' => 'delivery',
'primary' => 'id_delivery',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectsNodeName' => 'deliveries', 'objectsNodeName' => 'deliveries',
+4 -2
View File
@@ -73,8 +73,10 @@ class EmployeeCore extends ObjectModel
'passwd' => 'isPasswdAdmin', 'active' => 'isBool', 'id_profile' => 'isInt', 'bo_color' => 'isColor', 'bo_theme' => 'isGenericName', 'passwd' => 'isPasswdAdmin', 'active' => 'isBool', 'id_profile' => 'isInt', 'bo_color' => 'isColor', 'bo_theme' => 'isGenericName',
'bo_show_screencast' => 'isBool'); 'bo_show_screencast' => 'isBool');
protected $table = 'employee'; public static $definition = array(
protected $identifier = 'id_employee'; 'table' => 'employee',
'primary' => 'id_employee',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+4 -2
View File
@@ -38,8 +38,10 @@ class FeatureCore extends ObjectModel
'position' => 'isInt' 'position' => 'isInt'
); );
protected $table = 'feature'; public static $definition = array(
protected $identifier = 'id_feature'; 'table' => 'feature',
'primary' => 'id_feature',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectsNodeName' => 'product_features', 'objectsNodeName' => 'product_features',
+5 -2
View File
@@ -46,8 +46,11 @@ class FeatureValueCore extends ObjectModel
protected $fieldsSizeLang = array('value' => 255); protected $fieldsSizeLang = array('value' => 255);
protected $fieldsValidateLang = array('value' => 'isGenericName'); protected $fieldsValidateLang = array('value' => 'isGenericName');
protected $table = 'feature_value'; public static $definition = array(
protected $identifier = 'id_feature_value'; 'table' => 'feature_value',
'primary' => 'id_feature_value',
'multilang' => true,
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectsNodeName' => 'product_feature_values', 'objectsNodeName' => 'product_feature_values',
+5 -2
View File
@@ -54,8 +54,11 @@ class GroupCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 32); protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'group'; public static $definition = array(
protected $identifier = 'id_group'; 'table' => 'group',
'primary' => 'id_group',
'multilang' => true,
);
protected static $cache_reduction = array(); protected static $cache_reduction = array();
protected static $group_price_display_method = array(); protected static $group_price_display_method = array();
+4 -2
View File
@@ -34,8 +34,10 @@ class GroupReductionCore extends ObjectModel
protected $fieldsRequired = array('id_group', 'id_category', 'reduction'); protected $fieldsRequired = array('id_group', 'id_category', 'reduction');
protected $fieldsValidate = array('id_group' => 'isUnsignedId', 'id_category' => 'isUnsignedId', 'reduction' => 'isPrice'); protected $fieldsValidate = array('id_group' => 'isUnsignedId', 'id_category' => 'isUnsignedId', 'reduction' => 'isPrice');
protected $table = 'group_reduction'; public static $definition = array(
protected $identifier = 'id_group_reduction'; 'table' => 'group_reduction',
'primary' => 'id_group_reduction',
);
protected static $reduction_cache = array(); protected static $reduction_cache = array();
+4 -3
View File
@@ -60,9 +60,10 @@ class GuestCore extends ObjectModel
'accept_language' => 'isGenericName' 'accept_language' => 'isGenericName'
); );
protected $table = 'guest'; public static $definition = array(
protected $identifier = 'id_guest'; 'table' => 'guest',
'primary' => 'id_guest',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+4 -2
View File
@@ -35,8 +35,10 @@ class HookCore extends ObjectModel
protected $fieldsSize = array('name' => 32); protected $fieldsSize = array('name' => 32);
protected $fieldsValidate = array('name' => 'isHookName'); protected $fieldsValidate = array('name' => 'isHookName');
protected $table = 'hook'; public static $definition = array(
protected $identifier = 'id_hook'; 'table' => 'hook',
'primary' => 'id_hook',
);
protected static $_hookModulesCache; protected static $_hookModulesCache;
+5 -2
View File
@@ -67,8 +67,11 @@ class ImageCore extends ObjectModel
protected $fieldsSizeLang = array('legend' => 128); protected $fieldsSizeLang = array('legend' => 128);
protected $fieldsValidateLang = array('legend' => 'isGenericName'); protected $fieldsValidateLang = array('legend' => 'isGenericName');
protected $table = 'image'; public static $definition = array(
protected $identifier = 'id_image'; 'table' => 'image',
'primary' => 'id_image',
'multilang' => true,
);
protected static $_cacheGetSize = array(); protected static $_cacheGetSize = array();
+4 -2
View File
@@ -70,8 +70,10 @@ class ImageTypeCore extends ObjectModel
); );
protected $fieldsSize = array('name' => 16); protected $fieldsSize = array('name' => 16);
protected $table = 'image_type'; public static $definition = array(
protected $identifier = 'id_image_type'; 'table' => 'image_type',
'primary' => 'id_image_type',
);
/** /**
* @var array Image types cache * @var array Image types cache
+4 -2
View File
@@ -55,8 +55,10 @@ class LanguageCore extends ObjectModel
protected $fieldsValidate = array('name' => 'isGenericName', 'iso_code' => 'isLanguageIsoCode', 'language_code' => 'isLanguageCode', protected $fieldsValidate = array('name' => 'isGenericName', 'iso_code' => 'isLanguageIsoCode', 'language_code' => 'isLanguageCode',
'active' => 'isBool', 'is_rtl' => 'isBool', 'date_format_lite' => 'isPhpDateFormat', 'date_format_full' => 'isPhpDateFormat'); 'active' => 'isBool', 'is_rtl' => 'isBool', 'date_format_lite' => 'isPhpDateFormat', 'date_format_full' => 'isPhpDateFormat');
protected $table = 'lang'; public static $definition = array(
protected $identifier = 'id_lang'; 'table' => 'lang',
'primary' => 'id_lang',
);
/** @var array Languages cache */ /** @var array Languages cache */
protected static $_checkedLangs; protected static $_checkedLangs;
+4 -2
View File
@@ -56,8 +56,10 @@ class LoggerCore extends ObjectModel
protected $fieldsValidate = array('id_log' => 'isUnsignedId', 'severity' => 'isInt', 'error_code' => 'isUnsignedInt', protected $fieldsValidate = array('id_log' => 'isUnsignedId', 'severity' => 'isInt', 'error_code' => 'isUnsignedInt',
'message' => 'isMessage', 'object_id' => 'isUnsignedInt', 'object_type' => 'isName'); 'message' => 'isMessage', 'object_id' => 'isUnsignedInt', 'object_type' => 'isName');
protected $table = 'log'; public static $definition = array(
protected $identifier = 'id_log'; 'table' => 'log',
'primary' => 'id_log',
);
protected static $is_present = array(); protected static $is_present = array();
+7 -2
View File
@@ -81,8 +81,13 @@ class ManufacturerCore extends ObjectModel
'meta_description' => 'isGenericName', 'meta_description' => 'isGenericName',
'meta_keywords' => 'isGenericName' 'meta_keywords' => 'isGenericName'
); );
protected $table = 'manufacturer';
protected $identifier = 'id_manufacturer'; public static $definition = array(
'table' => 'manufacturer',
'primary' => 'id_manufacturer',
'multilang' => true,
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
'active' => array(), 'active' => array(),
+4 -2
View File
@@ -56,8 +56,10 @@ class MessageCore extends ObjectModel
'message' => 'isCleanHtml', 'id_cart' => 'isUnsignedId', 'id_order' => 'isUnsignedId', 'message' => 'isCleanHtml', 'id_cart' => 'isUnsignedId', 'id_order' => 'isUnsignedId',
'id_customer' => 'isUnsignedId', 'id_employee' => 'isUnsignedId', 'private' => 'isBool'); 'id_customer' => 'isUnsignedId', 'id_employee' => 'isUnsignedId', 'private' => 'isBool');
protected $table = 'message'; public static $definition = array(
protected $identifier = 'id_message'; 'table' => 'message',
'primary' => 'id_message',
);
public function getFields() public function getFields()
{ {
+6 -2
View File
@@ -43,8 +43,12 @@ class MetaCore extends ObjectModel
protected $fieldsValidateLang = array('title' => 'isGenericName', 'description' => 'isGenericName', 'keywords' => 'isGenericName', 'url_rewrite' => 'isLinkRewrite'); protected $fieldsValidateLang = array('title' => 'isGenericName', 'description' => 'isGenericName', 'keywords' => 'isGenericName', 'url_rewrite' => 'isLinkRewrite');
protected $langMultiShop = true; protected $langMultiShop = true;
protected $table = 'meta';
protected $identifier = 'id_meta'; public static $definition = array(
'table' => 'meta',
'primary' => 'id_meta',
'multilang' => true,
);
public function getFields() public function getFields()
{ {
+4 -3
View File
@@ -68,9 +68,10 @@ abstract class ModuleCore
protected $_errors = false; protected $_errors = false;
protected $table = 'module'; public static $definition = array(
'table' => 'module',
protected $identifier = 'id_module'; 'primary' => 'id_module',
);
public static $_db; public static $_db;
+4 -2
View File
@@ -35,8 +35,10 @@ class PageCore extends ObjectModel
protected $fieldsRequired = array ('id_page_type'); protected $fieldsRequired = array ('id_page_type');
protected $fieldsValidate = array ('id_page_type' => 'isUnsignedId', 'id_object' => 'isUnsignedId'); protected $fieldsValidate = array ('id_page_type' => 'isUnsignedId', 'id_object' => 'isUnsignedId');
protected $table = 'page'; public static $definition = array(
protected $identifier = 'id_page'; 'table' => 'page',
'primary' => 'id_page',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -49,8 +49,10 @@ class PaymentCCCore extends OrderPayment
'id_order' => 'isUnsignedId', 'id_currency' => 'isUnsignedId', 'amount' => 'isPrice', 'id_order' => 'isUnsignedId', 'id_currency' => 'isUnsignedId', 'amount' => 'isPrice',
'transaction_id' => 'isAnything', 'card_number' => 'isAnything', 'card_brand' => 'isAnything', 'card_expiration' => 'isAnything', 'card_holder' => 'isAnything'); 'transaction_id' => 'isAnything', 'card_number' => 'isAnything', 'card_brand' => 'isAnything', 'card_expiration' => 'isAnything', 'card_holder' => 'isAnything');
protected $table = 'payment_cc'; public static $definition = array(
protected $identifier = 'id_payment_cc'; 'table' => 'payment_cc',
'primary' => 'id_payment_cc',
);
/** /**
* @deprecated 1.5.0.2 * @deprecated 1.5.0.2
+5 -2
View File
@@ -261,8 +261,11 @@ class ProductCore extends ObjectModel
'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'name' => 'isCatalogName', 'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'name' => 'isCatalogName',
'description' => 'isString', 'description_short' => 'isString', 'available_now' => 'isGenericName', 'available_later' => 'IsGenericName'); 'description' => 'isString', 'description_short' => 'isString', 'available_now' => 'isGenericName', 'available_later' => 'IsGenericName');
protected $table = 'product'; public static $definition = array(
protected $identifier = 'id_product'; 'table' => 'product',
'primary' => 'id_product',
'multilang' => true,
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectMethods' => array( 'objectMethods' => array(
+4 -2
View File
@@ -86,8 +86,10 @@ class ProductDownloadCore extends ObjectModel
'is_shareable' => 'isUnsignedInt' 'is_shareable' => 'isUnsignedInt'
); );
protected $table = 'product_download'; public static $definition = array(
protected $identifier = 'id_product_download'; 'table' => 'product_download',
'primary' => 'id_product_download',
);
/** /**
* Build a virtual product * Build a virtual product
+5 -2
View File
@@ -34,8 +34,11 @@ class ProfileCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 32); protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'profile'; public static $definition = array(
protected $identifier = 'id_profile'; 'table' => 'profile',
'primary' => 'id_profile',
'multilang' => true,
);
public function getFields() public function getFields()
{ {
+5 -2
View File
@@ -43,8 +43,11 @@ class QuickAccessCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 32); protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'quick_access'; public static $definition = array(
protected $identifier = 'id_quick_access'; 'table' => 'quick_access',
'primary' => 'id_quick_access',
'multilang' => true,
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -34,8 +34,10 @@ class RangePriceCore extends ObjectModel
protected $fieldsRequired = array('id_carrier', 'delimiter1', 'delimiter2'); protected $fieldsRequired = array('id_carrier', 'delimiter1', 'delimiter2');
protected $fieldsValidate = array('id_carrier' => 'isInt', 'delimiter1' => 'isUnsignedFloat', 'delimiter2' => 'isUnsignedFloat'); protected $fieldsValidate = array('id_carrier' => 'isInt', 'delimiter1' => 'isUnsignedFloat', 'delimiter2' => 'isUnsignedFloat');
protected $table = 'range_price'; public static $definition = array(
protected $identifier = 'id_range_price'; 'table' => 'range_price',
'primary' => 'id_range_price',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectsNodeName' => 'price_ranges', 'objectsNodeName' => 'price_ranges',
+4 -2
View File
@@ -34,8 +34,10 @@ class RangeWeightCore extends ObjectModel
protected $fieldsRequired = array('id_carrier', 'delimiter1', 'delimiter2'); protected $fieldsRequired = array('id_carrier', 'delimiter1', 'delimiter2');
protected $fieldsValidate = array('id_carrier' => 'isInt', 'delimiter1' => 'isUnsignedFloat', 'delimiter2' => 'isUnsignedFloat'); protected $fieldsValidate = array('id_carrier' => 'isInt', 'delimiter1' => 'isUnsignedFloat', 'delimiter2' => 'isUnsignedFloat');
protected $table = 'range_weight'; public static $definition = array(
protected $identifier = 'id_range_weight'; 'table' => 'range_weight',
'primary' => 'id_range_weight',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectNodeName' => 'weight_range', 'objectNodeName' => 'weight_range',
+4 -2
View File
@@ -73,8 +73,10 @@ class ReferrerCore extends ObjectModel
'click_fee' => 'isFloat' 'click_fee' => 'isFloat'
); );
protected $table = 'referrer'; public static $definition = array(
protected $identifier = 'id_referrer'; 'table' => 'referrer',
'primary' => 'id_referrer',
);
protected static $_join = '(r.http_referer_like IS NULL OR r.http_referer_like = \'\' OR cs.http_referer LIKE r.http_referer_like) protected static $_join = '(r.http_referer_like IS NULL OR r.http_referer_like = \'\' OR cs.http_referer LIKE r.http_referer_like)
AND (r.request_uri_like IS NULL OR r.request_uri_like = \'\' OR cs.request_uri LIKE r.request_uri_like) AND (r.request_uri_like IS NULL OR r.request_uri_like = \'\' OR cs.request_uri LIKE r.request_uri_like)
+4 -2
View File
@@ -34,8 +34,10 @@ class RequestSqlCore extends ObjectModel
protected $fieldsSize = array('name' => 200 , 'sql' => 400); protected $fieldsSize = array('name' => 200 , 'sql' => 400);
protected $fieldsValidate = array('name' => 'isString', 'sql' => 'isString'); protected $fieldsValidate = array('name' => 'isString', 'sql' => 'isString');
protected $table = 'request_sql'; public static $definition = array(
protected $identifier = 'id_request_sql'; 'table' => 'request_sql',
'primary' => 'id_request_sql',
);
public $tested = array('required' => array ('SELECT', 'FROM'), public $tested = array('required' => array ('SELECT', 'FROM'),
'option' => array('WHERE', 'ORDER', 'LIMIT', 'HAVING', 'GROUP', 'UNION'), 'option' => array('WHERE', 'ORDER', 'LIMIT', 'HAVING', 'GROUP', 'UNION'),
+5 -2
View File
@@ -42,8 +42,11 @@ class SceneCore extends ObjectModel
/** @var array Products */ /** @var array Products */
public $products; public $products;
protected $table = 'scene'; public static $definition = array(
protected $identifier = 'id_scene'; 'table' => 'scene',
'primary' => 'id_scene',
'multilang' => true,
);
protected $fieldsRequired = array('active'); protected $fieldsRequired = array('active');
protected $fieldsValidate = array('active' => 'isBool', 'zones' => 'isSceneZones', 'categories' => 'isArrayWithIds'); protected $fieldsValidate = array('active' => 'isBool', 'zones' => 'isSceneZones', 'categories' => 'isArrayWithIds');
+4 -2
View File
@@ -33,8 +33,10 @@ class SearchEngineCore extends ObjectModel
protected $fieldsRequired = array ('server', 'getvar'); protected $fieldsRequired = array ('server', 'getvar');
protected $fieldsValidate = array ('server' => 'isUrl', 'getvar' => 'isModuleName'); protected $fieldsValidate = array ('server' => 'isUrl', 'getvar' => 'isModuleName');
protected $table = 'search_engine'; public static $definition = array(
protected $identifier = 'id_search_engine'; 'table' => 'search_engine',
'primary' => 'id_search_engine',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -43,8 +43,10 @@ class SpecificPriceCore extends ObjectModel
protected $fieldsRequired = array('id_product', 'id_shop', 'id_currency', 'id_country', 'id_group', 'price', 'from_quantity', 'reduction', 'reduction_type', 'from', 'to'); protected $fieldsRequired = array('id_product', 'id_shop', 'id_currency', 'id_country', 'id_group', 'price', 'from_quantity', 'reduction', 'reduction_type', 'from', 'to');
protected $fieldsValidate = array('id_group_shop' => 'isUnsignedId', 'id_product' => 'isUnsignedId', 'id_product_attribute' => 'isUnsignedId', 'id_shop' => 'isUnsignedId', 'id_country' => 'isUnsignedId', 'id_group' => 'isUnsignedId', 'price' => 'isPrice', 'from_quantity' => 'isUnsignedInt', 'reduction' => 'isPrice', 'reduction_type' => 'isReductionType', 'from' => 'isDateFormat', 'to' => 'isDateFormat'); protected $fieldsValidate = array('id_group_shop' => 'isUnsignedId', 'id_product' => 'isUnsignedId', 'id_product_attribute' => 'isUnsignedId', 'id_shop' => 'isUnsignedId', 'id_country' => 'isUnsignedId', 'id_group' => 'isUnsignedId', 'price' => 'isPrice', 'from_quantity' => 'isUnsignedInt', 'reduction' => 'isPrice', 'reduction_type' => 'isReductionType', 'from' => 'isDateFormat', 'to' => 'isDateFormat');
protected $table = 'specific_price'; public static $definition = array(
protected $identifier = 'id_specific_price'; 'table' => 'specific_price',
'primary' => 'id_specific_price',
);
protected static $_specificPriceCache = array(); protected static $_specificPriceCache = array();
protected static $_cache_priorities = array(); protected static $_cache_priorities = array();
+4 -2
View File
@@ -46,8 +46,10 @@ class StateCore extends ObjectModel
protected $fieldsSize = array('iso_code' => 4, 'name' => 32); protected $fieldsSize = array('iso_code' => 4, 'name' => 32);
protected $fieldsValidate = array('id_country' => 'isUnsignedId', 'id_zone' => 'isUnsignedId', 'iso_code' => 'isStateIsoCode', 'name' => 'isGenericName', 'active' => 'isBool'); protected $fieldsValidate = array('id_country' => 'isUnsignedId', 'id_zone' => 'isUnsignedId', 'iso_code' => 'isStateIsoCode', 'name' => 'isGenericName', 'active' => 'isBool');
protected $table = 'state'; public static $definition = array(
protected $identifier = 'id_state'; 'table' => 'state',
'primary' => 'id_state',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+4 -2
View File
@@ -84,8 +84,10 @@ class StoreCore extends ObjectModel
'city' => 'isCityName', 'latitude' => 'isCoordinate', 'longitude' => 'isCoordinate', 'hours' => 'isSerializedArray', 'phone' => 'isPhoneNumber', 'fax' => 'isPhoneNumber', 'city' => 'isCityName', 'latitude' => 'isCoordinate', 'longitude' => 'isCoordinate', 'hours' => 'isSerializedArray', 'phone' => 'isPhoneNumber', 'fax' => 'isPhoneNumber',
'note' => 'isCleanHtml', 'email' => 'isEmail', 'active' => 'isBool'); 'note' => 'isCleanHtml', 'email' => 'isEmail', 'active' => 'isBool');
protected $table = 'store'; public static $definition = array(
protected $identifier = 'id_store'; 'table' => 'store',
'primary' => 'id_store',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+4 -2
View File
@@ -33,8 +33,10 @@ class SubDomainCore extends ObjectModel
protected $fieldsSize = array('name' => 16); protected $fieldsSize = array('name' => 16);
protected $fieldsValidate = array('name' => 'isSubDomainName'); protected $fieldsValidate = array('name' => 'isSubDomainName');
protected $table = 'subdomain'; public static $definition = array(
protected $identifier = 'id_subdomain'; 'table' => 'subdomain',
'primary' => 'id_subdomain',
);
public function getFields() public function getFields()
{ {
+5 -2
View File
@@ -70,8 +70,11 @@ class SupplierCore extends ObjectModel
'meta_keywords' => 'isGenericName' 'meta_keywords' => 'isGenericName'
); );
protected $table = 'supplier'; public static $definition = array(
protected $identifier = 'id_supplier'; 'table' => 'supplier',
'primary' => 'id_supplier',
'multilang' => true,
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+5 -2
View File
@@ -53,8 +53,11 @@ class TabCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 32); protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'tab'; public static $definition = array(
protected $identifier = 'id_tab'; 'table' => 'tab',
'primary' => 'id_tab',
'multilang' => true,
);
protected static $_getIdFromClassName = null; protected static $_getIdFromClassName = null;
+4 -2
View File
@@ -36,8 +36,10 @@ class TagCore extends ObjectModel
protected $fieldsRequired = array('id_lang', 'name'); protected $fieldsRequired = array('id_lang', 'name');
protected $fieldsValidate = array('id_lang' => 'isUnsignedId', 'name' => 'isGenericName'); protected $fieldsValidate = array('id_lang' => 'isUnsignedId', 'name' => 'isGenericName');
protected $table = 'tag'; public static $definition = array(
protected $identifier = 'id_tag'; 'table' => 'tag',
'primary' => 'id_tag',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+5 -2
View File
@@ -31,8 +31,11 @@ class ThemeCore extends ObjectModel
protected $fieldsSize = array('name' => 64); protected $fieldsSize = array('name' => 64);
protected $fieldsValidate = array('name' => 'isGenericName'); protected $fieldsValidate = array('name' => 'isGenericName');
protected $table = 'theme';
protected $identifier = 'id_theme'; public static $definition = array(
'table' => 'theme',
'primary' => 'id_theme',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -38,8 +38,10 @@ class ZoneCore extends ObjectModel
protected $fieldsSize = array('name' => 64); protected $fieldsSize = array('name' => 64);
protected $fieldsValidate = array('name' => 'isGenericName', 'active' => 'isBool'); protected $fieldsValidate = array('name' => 'isGenericName', 'active' => 'isBool');
protected $table = 'zone'; public static $definition = array(
protected $identifier = 'id_zone'; 'table' => 'zone',
'primary' => 'id_zone',
);
protected $webserviceParameters = array(); protected $webserviceParameters = array();
+5 -2
View File
@@ -223,8 +223,11 @@ class OrderCore extends ObjectModel
); );
/* MySQL does not allow 'order' for a table name */ /* MySQL does not allow 'order' for a table name */
protected $table = 'orders'; public static $definition = array(
protected $identifier = 'id_order'; 'table' => 'orders',
'primary' => 'id_order',
);
protected $_taxCalculationMethod = PS_TAX_EXC; protected $_taxCalculationMethod = PS_TAX_EXC;
protected static $_historyCache = array(); protected static $_historyCache = array();
+4 -2
View File
@@ -48,8 +48,10 @@ class OrderCartRuleCore extends ObjectModel
protected $fieldsValidate = array ('id_order' => 'isUnsignedId', 'name' => 'isGenericName', 'value' => 'isInt'); protected $fieldsValidate = array ('id_order' => 'isUnsignedId', 'name' => 'isGenericName', 'value' => 'isInt');
/* MySQL does not allow 'order detail' for a table name */ /* MySQL does not allow 'order detail' for a table name */
protected $table = 'order_cart_rule'; public static $definition = array(
protected $identifier = 'id_order_cart_rule'; 'table' => 'order_cart_rule',
'primary' => 'id_order_cart_rule',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+4 -2
View File
@@ -174,8 +174,10 @@ class OrderDetailCore extends ObjectModel
'total_price_tax_excl' => 'isPrice' 'total_price_tax_excl' => 'isPrice'
); );
protected $table = 'order_detail'; public static $definition = array(
protected $identifier = 'id_order_detail'; 'table' => 'order_detail',
'primary' => 'id_order_detail',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array ( 'fields' => array (
+4 -2
View File
@@ -47,8 +47,10 @@ class OrderHistoryCore extends ObjectModel
protected $fieldsRequired = array('id_order', 'id_order_state'); protected $fieldsRequired = array('id_order', 'id_order_state');
protected $fieldsValidate = array('id_order' => 'isUnsignedId', 'id_order_state' => 'isUnsignedId', 'id_employee' => 'isUnsignedId'); protected $fieldsValidate = array('id_order' => 'isUnsignedId', 'id_order_state' => 'isUnsignedId', 'id_employee' => 'isUnsignedId');
protected $table = 'order_history'; public static $definition = array(
protected $identifier = 'id_order_history'; 'table' => 'order_history',
'primary' => 'id_order_history',
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'objectsNodeName' => 'order_histories', 'objectsNodeName' => 'order_histories',
+5 -2
View File
@@ -44,8 +44,11 @@ class OrderMessageCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 128, 'message' => 1200); protected $fieldsSizeLang = array('name' => 128, 'message' => 1200);
protected $fieldsValidateLang = array('name' => 'isGenericName', 'message' => 'isMessage'); protected $fieldsValidateLang = array('name' => 'isGenericName', 'message' => 'isMessage');
protected $table = 'order_message'; public static $definition = array(
protected $identifier = 'id_order_message'; 'table' => 'order_message',
'primary' => 'id_order_message',
'multilang' => true,
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+4 -2
View File
@@ -53,8 +53,10 @@ class OrderReturnCore extends ObjectModel
protected $fieldsRequired = array ('id_customer', 'id_order'); protected $fieldsRequired = array ('id_customer', 'id_order');
protected $fieldsValidate = array('id_customer' => 'isUnsignedId', 'id_order' => 'isUnsignedId', 'question' => 'isMessage'); protected $fieldsValidate = array('id_customer' => 'isUnsignedId', 'id_order' => 'isUnsignedId', 'question' => 'isMessage');
protected $table = 'order_return'; public static $definition = array(
protected $identifier = 'id_order_return'; 'table' => 'order_return',
'primary' => 'id_order_return',
);
public function getFields() public function getFields()
{ {
+5 -2
View File
@@ -38,8 +38,11 @@ class OrderReturnStateCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 64); protected $fieldsSizeLang = array('name' => 64);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'order_return_state'; public static $definition = array(
protected $identifier = 'id_order_return_state'; 'table' => 'order_return_state',
'primary' => 'id_order_return_state',
'multilang' => true,
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -62,8 +62,10 @@ class OrderSlipCore extends ObjectModel
protected $fieldsRequired = array ('id_customer', 'id_order', 'conversion_rate'); protected $fieldsRequired = array ('id_customer', 'id_order', 'conversion_rate');
protected $fieldsValidate = array('id_customer' => 'isUnsignedId', 'id_order' => 'isUnsignedId', 'conversion_rate' => 'isFloat'); protected $fieldsValidate = array('id_customer' => 'isUnsignedId', 'id_order' => 'isUnsignedId', 'conversion_rate' => 'isFloat');
protected $table = 'order_slip'; public static $definition = array(
protected $identifier = 'id_order_slip'; 'table' => 'order_slip',
'primary' => 'id_order_slip',
);
public function getFields() public function getFields()
{ {
+5 -2
View File
@@ -68,8 +68,11 @@ class OrderStateCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 64, 'template' => 64); protected $fieldsSizeLang = array('name' => 64, 'template' => 64);
protected $fieldsValidateLang = array('name' => 'isGenericName', 'template' => 'isTplName'); protected $fieldsValidateLang = array('name' => 'isGenericName', 'template' => 'isTplName');
protected $table = 'order_state'; public static $definition = array(
protected $identifier = 'id_order_state'; 'table' => 'order_state',
'primary' => 'id_order_state',
'multilang' => true,
);
protected $webserviceParameters = array( protected $webserviceParameters = array(
'fields' => array( 'fields' => array(
+5 -2
View File
@@ -45,8 +45,11 @@ class GroupShopCore extends ObjectModel
'share_stock' => 'isBool', 'share_stock' => 'isBool',
'name' => 'isGenericName', 'name' => 'isGenericName',
); );
protected $table = 'group_shop';
protected $identifier = 'id_group_shop'; public static $definition = array(
'table' => 'group_shop',
'primary' => 'id_group_shop',
);
private static $assoTables = array( private static $assoTables = array(
'attribute_group' => array('type' => 'group_shop'), 'attribute_group' => array('type' => 'group_shop'),
+5 -2
View File
@@ -54,8 +54,11 @@ class ShopCore extends ObjectModel
'active' => 'isBool', 'active' => 'isBool',
'name' => 'isGenericName', 'name' => 'isGenericName',
); );
protected $table = 'shop';
protected $identifier = 'id_shop'; public static $definition = array(
'table' => 'shop',
'primary' => 'id_shop',
);
/** @var array List of shops cached */ /** @var array List of shops cached */
protected static $shops; protected static $shops;
+4 -2
View File
@@ -42,8 +42,10 @@ class ShopUrlCore extends ObjectModel
protected $fieldsSize = array('domain' => 255, 'physical_uri' => 64, 'virtual_uri' => 64); protected $fieldsSize = array('domain' => 255, 'physical_uri' => 64, 'virtual_uri' => 64);
protected $fieldsValidate = array('active' => 'isBool'); protected $fieldsValidate = array('active' => 'isBool');
protected $table = 'shop_url'; public static $definition = array(
protected $identifier = 'id_shop_url'; 'table' => 'shop_url',
'primary' => 'id_shop_url',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -74,8 +74,10 @@ class StockAvailableCore extends ObjectModel
'out_of_stock' => 'isInt' 'out_of_stock' => 'isInt'
); );
protected $table = 'stock_available'; public static $definition = array(
protected $identifier = 'id_stock_available'; 'table' => 'stock_available',
'primary' => 'id_stock_available',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -122,8 +122,10 @@ class StockMvtCore extends ObjectModel
*/ */
public $quantity; public $quantity;
protected $table = 'stock_mvt'; public static $definition = array(
protected $identifier = 'id_stock_mvt'; 'table' => 'stock_mvt',
'primary' => 'id_stock_mvt',
);
protected $fieldsRequired = array( protected $fieldsRequired = array(
'date_add', 'date_add',
+6 -2
View File
@@ -45,8 +45,12 @@ class StockMvtReasonCore extends ObjectModel
/** @var boolean True if the movement reason has been deleted (staying in database as deleted) */ /** @var boolean True if the movement reason has been deleted (staying in database as deleted) */
public $deleted = 0; public $deleted = 0;
protected $table = 'stock_mvt_reason'; public static $definition = array(
protected $identifier = 'id_stock_mvt_reason'; 'table' => 'stock_mvt_reason',
'primary' => 'id_stock_mvt_reason',
'multilang' => true,
);
protected $fieldsRequiredLang = array('name'); protected $fieldsRequiredLang = array('name');
protected $fieldsSizeLang = array('name' => 255); protected $fieldsSizeLang = array('name' => 255);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
+4 -9
View File
@@ -154,15 +154,10 @@ class SupplyOrderCore extends ObjectModel
'is_template' => 'isBool', 'is_template' => 'isBool',
); );
/** public static $definition = array(
* @var string Database table name 'table' => 'supply_order',
*/ 'primary' => 'id_supply_order',
protected $table = 'supply_order'; );
/**
* @var string Database ID name
*/
protected $identifier = 'id_supply_order';
public function getFields() public function getFields()
{ {
+4 -9
View File
@@ -76,15 +76,10 @@ class SupplyOrderHistoryCore extends ObjectModel
'date_add' => 'isDate' 'date_add' => 'isDate'
); );
/** public static $definition = array(
* @var string Database table name 'table' => 'supply_order_history',
*/ 'primary' => 'id_supply_order_history',
protected $table = 'supply_order_history'; );
/**
* @var string Database ID name
*/
protected $identifier = 'id_supply_order_history';
public function getFields() public function getFields()
{ {
+4 -9
View File
@@ -82,15 +82,10 @@ class SupplyOrderReceiptHistoryCore extends ObjectModel
'date_add' => 'isDate' 'date_add' => 'isDate'
); );
/** public static $definition = array(
* @var string Database table name 'table' => 'supply_order_receipt_history',
*/ 'primary' => 'id_supply_order_receipt_history',
protected $table = 'supply_order_receipt_history'; );
/**
* @var string Database ID name
*/
protected $identifier = 'id_supply_order_receipt_history';
public function getFields() public function getFields()
{ {
+5 -9
View File
@@ -78,15 +78,11 @@ class SupplyOrderStateCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 128); protected $fieldsSizeLang = array('name' => 128);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
/** public static $definition = array(
* @var string Database table name 'table' => 'supply_order_state',
*/ 'primary' => 'id_supply_order_state',
protected $table = 'supply_order_state'; 'multilang' => true,
);
/**
* @var string Database ID name
*/
protected $identifier = 'id_supply_order_state';
/** /**
* @see ObjectModel::getFields() * @see ObjectModel::getFields()
+4 -2
View File
@@ -83,8 +83,10 @@ class WarehouseCore extends ObjectModel
'id_currency' => 'isUnsignedId' 'id_currency' => 'isUnsignedId'
); );
protected $table = 'warehouse'; public static $definition = array(
protected $identifier = 'id_warehouse'; 'table' => 'warehouse',
'primary' => 'id_warehouse',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -49,8 +49,10 @@ class TaxCore extends ObjectModel
protected $fieldsSizeLang = array('name' => 32); protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName'); protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'tax'; public static $definition = array(
protected $identifier = 'id_tax'; 'table' => 'tax',
'primary' => 'id_tax',
);
protected static $_product_country_tax = array(); protected static $_product_country_tax = array();
protected static $_product_tax_via_rules = array(); protected static $_product_tax_via_rules = array();
+4 -2
View File
@@ -46,8 +46,10 @@ class TaxRuleCore extends ObjectModel
'behavior' => 'isUnsignedInt', 'behavior' => 'isUnsignedInt',
'description' => 'isString'); 'description' => 'isString');
protected $table = 'tax_rule'; public static $definition = array(
protected $identifier = 'id_tax_rule'; 'table' => 'tax_rule',
'primary' => 'id_tax_rule',
);
public function getFields() public function getFields()
{ {
+4 -2
View File
@@ -37,8 +37,10 @@ class TaxRulesGroupCore extends ObjectModel
protected $fieldsSize = array('name' => 64); protected $fieldsSize = array('name' => 64);
protected $fieldsValidate = array('name' => 'isGenericName'); protected $fieldsValidate = array('name' => 'isGenericName');
protected $table = 'tax_rules_group'; public static $definition = array(
protected $identifier = 'id_tax_rules_group'; 'table' => 'tax_rules_group',
'primary' => 'id_tax_rules_group',
);
protected static $_taxes = array(); protected static $_taxes = array();
+4 -3
View File
@@ -40,9 +40,10 @@ class WebserviceKeyCore extends ObjectModel
protected $fieldsSize = array('key' => 32); protected $fieldsSize = array('key' => 32);
protected $fieldsValidate = array('active' => 'isBool'); protected $fieldsValidate = array('active' => 'isBool');
protected $table = 'webservice_account'; public static $definition = array(
protected $identifier = 'id_webservice_account'; 'table' => 'webservice_account',
'primary' => 'id_webservice_account',
);
public function add($autodate = true, $nullValues = false) public function add($autodate = true, $nullValues = false)
{ {