// Format definitions
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11230 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -200,15 +200,6 @@ class AddressCore extends ObjectModel
|
||||
return $out;
|
||||
}
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$fields = parent::getFields();
|
||||
if (isset($this->id))
|
||||
$fields['id_address'] = (int)$this->id;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function validateController($htmlentities = true)
|
||||
{
|
||||
$errors = parent::validateController($htmlentities);
|
||||
|
||||
@@ -100,15 +100,6 @@ class CMSCategoryCore extends ObjectModel
|
||||
parent::__construct($id_cms_category, $id_lang);
|
||||
}
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$fields = parent::getFields();
|
||||
if (isset($this->id))
|
||||
$fields['id_cms_category'] = (int)($this->id);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check then return multilingual fields for database interaction
|
||||
*
|
||||
|
||||
+22
-41
@@ -84,21 +84,6 @@ class CartCore extends ObjectModel
|
||||
protected static $_nbProducts = array();
|
||||
protected static $_isVirtualCart = array();
|
||||
|
||||
protected $fieldsRequired = array('id_currency', 'id_lang');
|
||||
protected $fieldsValidate = array(
|
||||
'id_address_delivery' => 'isUnsignedId',
|
||||
'id_carrier' => 'isUnsignedId',
|
||||
'id_address_invoice' => 'isUnsignedId',
|
||||
'id_currency' => 'isUnsignedId',
|
||||
'id_customer' => 'isUnsignedId',
|
||||
'id_guest' => 'isUnsignedId',
|
||||
'id_lang' => 'isUnsignedId',
|
||||
'recyclable' => 'isBool',
|
||||
'gift' => 'isBool',
|
||||
'gift_message' => 'isMessage',
|
||||
'allow_seperated_package' => 'isBool'
|
||||
);
|
||||
|
||||
protected $_products = null;
|
||||
protected static $_totalWeight = array();
|
||||
protected $_taxCalculationMethod = PS_TAX_EXC;
|
||||
@@ -106,9 +91,31 @@ class CartCore extends ObjectModel
|
||||
protected static $_taxes_rate = null;
|
||||
protected static $_attributesLists = array();
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
public static $definition = array(
|
||||
'table' => 'cart',
|
||||
'primary' => 'id_cart',
|
||||
'fields' => array(
|
||||
'id_group_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_address_delivery' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_address_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_carrier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_guest' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'gift_message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage'),
|
||||
'delivery_option' => array('type' => self::TYPE_STRING),
|
||||
'secure_key' => array('type' => self::TYPE_STRING, 'size' => 32),
|
||||
'allow_seperated_package' =>array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
||||
),
|
||||
);
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
@@ -138,32 +145,6 @@ class CartCore extends ObjectModel
|
||||
const ONLY_WRAPPING = 6;
|
||||
const ONLY_PRODUCTS_WITHOUT_SHIPPING = 7;
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
$fields['id_group_shop'] = (int)$this->id_group_shop;
|
||||
$fields['id_shop'] = (int)$this->id_shop;
|
||||
|
||||
$fields['id_address_delivery'] = (int)$this->id_address_delivery;
|
||||
$fields['id_address_invoice'] = (int)$this->id_address_invoice;
|
||||
$fields['id_currency'] = (int)$this->id_currency;
|
||||
$fields['id_customer'] = (int)$this->id_customer;
|
||||
$fields['id_carrier'] = (int)$this->id_carrier;
|
||||
$fields['id_guest'] = (int)$this->id_guest;
|
||||
$fields['id_lang'] = (int)$this->id_lang;
|
||||
$fields['recyclable'] = (int)$this->recyclable;
|
||||
$fields['gift'] = (int)$this->gift;
|
||||
$fields['secure_key'] = pSQL($this->secure_key);
|
||||
$fields['gift_message'] = pSQL($this->gift_message);
|
||||
$fields['date_add'] = pSQL($this->date_add);
|
||||
$fields['date_upd'] = pSQL($this->date_upd);
|
||||
$fields['allow_seperated_package'] = (int)$this->allow_seperated_package;
|
||||
$fields['delivery_option'] = $this->delivery_option;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function __construct($id = null, $id_lang = null)
|
||||
{
|
||||
parent::__construct($id, $id_lang);
|
||||
|
||||
@@ -130,15 +130,6 @@ class CategoryCore extends ObjectModel
|
||||
$this->image_dir = _PS_CAT_IMG_DIR_;
|
||||
}
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$fields = parent::getFields();
|
||||
if (isset($this->id))
|
||||
$fields['id_category'] = (int)$this->id;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to display the category description without HTML tags and slashes
|
||||
*
|
||||
|
||||
@@ -156,19 +156,6 @@ class CustomerCore extends ObjectModel
|
||||
protected static $_customerHasAddress = array();
|
||||
protected static $_customer_groups = array();
|
||||
|
||||
/**
|
||||
* @see ObjectModel::getFields()
|
||||
* @return array
|
||||
*/
|
||||
public function getFields()
|
||||
{
|
||||
$fields = parent::getFields();
|
||||
if (isset($this->id))
|
||||
$fields['id_customer'] = (int)$this->id;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function add($autodate = true, $null_values = true)
|
||||
{
|
||||
$this->id_shop = ($this->id_shop) ? $this->id_shop : Context::getContext()->shop->getID();
|
||||
|
||||
@@ -67,19 +67,6 @@ class GroupCore extends ObjectModel
|
||||
|
||||
protected $webserviceParameters = array();
|
||||
|
||||
/**
|
||||
* @see ObjectModel::getFields()
|
||||
* @return array
|
||||
*/
|
||||
public function getFields()
|
||||
{
|
||||
$fields = parent::getFields();
|
||||
if (isset($this->id))
|
||||
$fields['id_group'] = (int)$this->id;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function getTranslationsFieldsChild()
|
||||
{
|
||||
if (!$this->validateFieldsLang())
|
||||
|
||||
+2
-2
@@ -38,8 +38,8 @@ class HookCore extends ObjectModel
|
||||
'table' => 'hook',
|
||||
'primary' => 'id_hook',
|
||||
'fields' => array(
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isHookName', 'required' => true, 'size' => 32),
|
||||
'title' => array('type' => self::TYPE_STRING),
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isHookName', 'required' => true, 'size' => 32),
|
||||
'title' => array('type' => self::TYPE_STRING),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -109,19 +109,6 @@ class ManufacturerCore extends ObjectModel
|
||||
$this->image_dir = _PS_MANU_IMG_DIR_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ObjectModel::getFields()
|
||||
* @return array
|
||||
*/
|
||||
public function getFields()
|
||||
{
|
||||
$fields = parent::getFields();
|
||||
if (isset($this->id))
|
||||
$fields['id_manufacturer'] = (int)$this->id;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function getTranslationsFieldsChild()
|
||||
{
|
||||
$this->validateFieldsLang();
|
||||
|
||||
@@ -235,7 +235,7 @@ abstract class ObjectModelCore
|
||||
|
||||
case self::TYPE_BOOL :
|
||||
$fields[$field] = (int)$this->$field;
|
||||
break;
|
||||
break;
|
||||
|
||||
case self::TYPE_FLOAT :
|
||||
$fields[$field] = (float)$this->$field;
|
||||
|
||||
@@ -402,9 +402,6 @@ class ProductCore extends ObjectModel
|
||||
public function getFields()
|
||||
{
|
||||
$fields = parent::getFields();
|
||||
|
||||
if (isset($this->id))
|
||||
$fields['id_product'] = (int)$this->id;
|
||||
$fields['unit_price_ratio'] = (float)$this->unit_price > 0 ? $this->price / $this->unit_price : 0;
|
||||
|
||||
return $fields;
|
||||
|
||||
Reference in New Issue
Block a user