[*] 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
This commit is contained in:
dMetzger
2012-07-09 12:35:11 +00:00
parent e7f6e0f2b9
commit 9074e8ed52
+6 -10
View File
@@ -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)