// Set $definition in ObjectModel classes for modules

This commit is contained in:
rMalie
2011-12-30 15:37:57 +00:00
parent 15b123aed1
commit 84f08cb76b
8 changed files with 157 additions and 249 deletions
@@ -31,27 +31,23 @@ class ProductCommentCriterion extends ObjectModel
public $id_product_comment_criterion_type;
public $name;
public $active = 1;
protected $fieldsRequiredLang = array('name');
protected $fieldsSizeLang = array('name' => 128);
protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'product_comment_criterion';
protected $identifier = 'id_product_comment_criterion';
public function getFields()
{
$this->validateFields();
return array('id_product_comment_criterion_type' => (int)$this->id_product_comment_criterion_type, 'active' => (int)$this->active);
}
public function getTranslationsFieldsChild()
{
$this->validateFieldsLang();
return $this->getTranslationsFields(array('name'));
}
public $active = true;
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'product_comment_criterion',
'primary' => 'id_product_comment_criterion',
'fields' => array(
'id_product_comment_criterion_type' => array('type' => self::TYPE_INT),
'active' => array('type' => self::TYPE_BOOL),
// Lang fields
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 128),
)
);
public function delete()
{
if (!parent::delete())