toutpratique/modules/cms_extrafields/classes/CmsPsExtraFieldsValue.php

42 lines
1.1 KiB
PHP
Raw Normal View History

<?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),
),
);
2015-09-24 17:57:29 +02:00
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();
}
}