[*] 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:
+6
-10
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user