*/ class MMModKnowledgebaseGroup extends MMModel { const VIS_GUEST = 1; const VIS_USER = 2; const VIS_ADMIN = 4; public $id; // unique id public $site_id; // website id public $title = ''; public $visible = 7; public $langu; // language identifier public $langukey; // common id to sync the text entries of different languages public function __construct() { } public static function fieldInfo() { $info = parent::fieldInfo(); $info['id'] = 'serial,unsigned,primary'; $info['site_id'] = 'int'; $info['title'] = 'char(255)'; $info['visible'] = 'set(1=anonymous,2=user,4=admin)'; $info['langu'] = 'char(6)'; $info['langukey'] = 'char(6)'; return $info; } public static function fieldDBMapping() { // copy and paste this to all childs, because php < 5.3 $result = array(); // dosen't support static::*() calls foreach (self::fieldInfo() as $field=>$info) $result[$field] = $field; // simple 1:1 mapping by default return $result; } // id public function getId() { return $this->id; } public function setId($id) { $id = (int) $id; if ($id < 0) throw new MFIllegalArgumentException("id colums can not be lesser than 0"); $this->id = $id; } // language public function getLang() { return $this->lang; } public function setLang($locale) { $locale = (string) $locale; if (strlen($locale) > 6) { Mammut::log(LOG_DEBUG,"locale string \"{$locale}\" was truncated to the first 6 characters"); $locale = substr($locale,0,6); } $this->lang = $locale; } public function getModifiedAt() { return $this->modifiedAt; } public function setModifiedAt($timestamp) { $this->modifiedAt = $timestamp; } } ?>