tableName = DB_PREFIX_SERVICE.$this->tableName; $this->DBObj($id); } function _getOrder4Grid() { return ' ORDER BY def '; } function getList($opt = array() ) { if (!isset($opt['addonWhere'])){ $opt['addonWhere'] = ''; } $opt['addonWhere'] .= ' AND enabled = "y" '; $list = $this->getList4Grid($opt); return $list['list']; } function getDefault() { static $name; if (is_null($name)) { $sql = "SELECT name FROM {$this->tableNameDB} WHERE def = 'y'"; $name = $this->db->queryOne($sql); } return $name; } function validName($name) { $list = array(); $_list = $this->getList(); foreach ($_list as $val) { $list[] = $val['name']; } if (!in_array($name, $list)){ $name = $list[0]; } return $name; } } ?>