19 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
46 function id($format =
'N')
48 return $this->getVar(
'confcat_id', $format);
54 function confcat_id($format =
'')
56 return $this->getVar(
'confcat_id', $format);
62 function confcat_name($format =
'')
64 return $this->getVar(
'confcat_name', $format);
70 function confcat_order($format =
'')
72 return $this->getVar(
'confcat_order', $format);
119 $sql =
'SELECT * FROM ' . $this->db->prefix(
'configcategory') .
' WHERE confcat_id=' . $id;
123 $numrows = $this->db->getRowsNum(
$result);
126 $confcat->assignVars($this->db->fetchArray(
$result),
false);
144 if (!is_a($confcat,
'xoopsconfigcategory')) {
147 if (!$confcat->isDirty()) {
150 if (!$confcat->cleanVars()) {
153 foreach ($confcat->cleanVars as $k => $v) {
156 if ($confcat->isNew()) {
157 $confcat_id = $this->db->genId(
'configcategory_confcat_id_seq');
158 $sql = sprintf(
"INSERT INTO %s (confcat_id, confcat_name, confcat_order) VALUES (%u, %s, %u)", $this->db->prefix(
'configcategory'),
$confcat_id, $this->db->quoteString($confcat_name), $confcat_order);
160 $sql = sprintf(
"UPDATE %s SET confcat_name = %s, confcat_order = %u WHERE confcat_id = %u", $this->db->prefix(
'configcategory'), $this->db->quoteString($confcat_name), $confcat_order,
$confcat_id);
179 function delete(&$confcat)
184 if (!is_a($confcat,
'xoopsconfigcategory')) {
188 $sql = sprintf(
"DELETE FROM %s WHERE confcat_id = %u", $this->db->prefix(
'configcategory'), $configcategory->getVar(
'confcat_id'));
207 $sql =
'SELECT * FROM ' . $this->db->prefix(
'configcategory');
210 $sort = !in_array(
$criteria->getSort(), array(
213 'confcat_order')) ?
'confcat_order' :
$criteria->getSort();
222 while ($myrow = $this->db->fetchArray(
$result)) {
224 $confcat->assignVars($myrow,
false);
228 $ret[$myrow[
'confcat_id']] = & $confcat;
240 trigger_error(__CLASS__ .
"::" . __FUNCTION__ .
' is deprecated', E_USER_WARNING);