19 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
46 function id($format =
'N')
48 return $this->getVar(
'confop_id', $format);
54 function confop_id($format =
'')
56 return $this->getVar(
'confop_id', $format);
62 function confop_name($format =
'')
64 return $this->getVar(
'confop_name', $format);
70 function confop_value($format =
'')
72 return $this->getVar(
'confop_value', $format);
78 function conf_id($format =
'')
80 return $this->getVar(
'conf_id', $format);
109 $confoption->setNew();
126 $sql =
'SELECT * FROM ' . $this->db->prefix(
'configoption') .
' WHERE confop_id=' . $id;
130 $numrows = $this->db->getRowsNum(
$result);
133 $confoption->assignVars($this->db->fetchArray(
$result));
150 if (!is_a($confoption,
'xoopsconfigoption')) {
153 if (!$confoption->isDirty()) {
156 if (!$confoption->cleanVars()) {
159 foreach ($confoption->cleanVars as $k => $v) {
162 if ($confoption->isNew()) {
163 $confop_id = $this->db->genId(
'configoption_confop_id_seq');
164 $sql = sprintf(
"INSERT INTO %s (confop_id, confop_name, confop_value, conf_id) VALUES (%u, %s, %s, %u)", $this->db->prefix(
'configoption'), $confop_id, $this->db->quoteString($confop_name), $this->db->quoteString($confop_value), $conf_id);
166 $sql = sprintf(
"UPDATE %s SET confop_name = %s, confop_value = %s WHERE confop_id = %u", $this->db->prefix(
'configoption'), $this->db->quoteString($confop_name), $this->db->quoteString($confop_value), $confop_id);
171 if (empty($confop_id)) {
172 $confop_id = $this->db->getInsertId();
174 $confoption->assignVar(
'confop_id', $confop_id);
184 function delete(&$confoption)
189 if (!is_a($confoption,
'xoopsconfigoption')) {
192 $sql = sprintf(
"DELETE FROM %s WHERE confop_id = %u", $this->db->prefix(
'configoption'), $confoption->getVar(
'confop_id'));
211 $sql =
'SELECT * FROM ' . $this->db->prefix(
'configoption');
221 while ($myrow = $this->db->fetchArray(
$result)) {
223 $confoption->assignVars($myrow);
225 $ret[] =& $confoption;
227 $ret[$myrow[
'confop_id']] = & $confoption;