toutpratique/modules/cms_extrafields/classes/CmsPsExtraFieldsValue.php
Marion Muszynski 79a0bf2d98 search tag
2015-09-24 18:02:24 +02:00

42 lines
1.1 KiB
PHP

<?php
class CmsPsExtraFieldsValue extends ObjectModel {
public $id_cmsps_extrafields_value;
public $id_group;
public $position;
public $value;
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'cmsps_extrafields_value',
'primary' => 'id_cmsps_extrafields_value',
'multilang' => TRUE,
'multilang_shop' => TRUE,
'fields' => array(
'position' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'id_group' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
// Lang fields
'value' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName', 'required' => TRUE, 'size' => 255),
),
);
public static function getAll ($all = true, $tache = false, $support = false, $id_lang) {
if($all){
$tache = false;
$support = false;
}
$collection = new Collection('CmsPsExtraFieldsValue', $id_lang);
if ($tache)
$collection->where('id_group','=',1);
elseif ($support)
$collection->where('id_group','=',2);
return $collection->getResults();
}
}