From 9074e8ed52bffe96fbc33ee4a4822dedea8d9108 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Mon, 9 Jul 2012 12:35:11 +0000 Subject: [PATCH] [*] BO : updated the "risk" class to the new 1.5 system (+several improvments) git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16281 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Risk.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/classes/Risk.php b/classes/Risk.php index 5775602e0..f8cb58d94 100644 --- a/classes/Risk.php +++ b/classes/Risk.php @@ -35,17 +35,15 @@ class RiskCore extends ObjectModel public $color; public $percent; - protected $fieldsRequired = array('percent'); - protected $fieldsSize = array(); - protected $fieldsValidate = array(); - protected $fieldsRequiredLang = array('name'); - protected $fieldsSizeLang = array('name' => 20); - protected $fieldsValidateLang = array('name' => 'isString'); - public static $definition = array( 'table' => 'risk', 'primary' => 'id_risk', 'multilang' => true, + 'fields' => array( + 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isString', 'required' => true, 'size' => 20), + 'color' => array('type' => self::TYPE_STRING, 'validate' => 'isColor', 'size' => 32), + 'percent' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt') + ), ); public function getFields() @@ -65,9 +63,7 @@ class RiskCore extends ObjectModel public function getTranslationsFieldsChild() { $this->validateFieldsLang(); - return $this->getTranslationsFields(array( - 'name', - )); + return $this->getTranslationsFields(array('name')); } public static function getRisks($id_lang = null)