// Set $definition in ObjectModel classes for modules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11950 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-30 15:37:57 +00:00
parent c07fb96831
commit 92b2d682f1
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())