- $pconfigs = dba::select('pconfig', ['cat', 'v', 'k'], ['uid' => $uid]);
- while ($pconfig = dba::fetch($pconfigs)) {
+ if (empty($uid)) {
+ return;
+ }
+
+ $pconfigs = DBA::select('pconfig', ['cat', 'v', 'k'], ['uid' => $uid]);
+ while ($pconfig = DBA::fetch($pconfigs)) {
self::getApp()->setPConfigValue($uid, $pconfig['cat'], $pconfig['k'], $pconfig['v']);
}
self::getApp()->setPConfigValue($uid, $pconfig['cat'], $pconfig['k'], $pconfig['v']);
}
$this->config_loaded = true;
}
public function get($uid, $cat, $k, $default_value = null, $refresh = false)
{
$this->config_loaded = true;
}
public function get($uid, $cat, $k, $default_value = null, $refresh = false)
{
- $config = dba::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
- if (DBM::is_result($config)) {
+ $config = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
+ if (DBA::isResult($config)) {
self::getApp()->setPConfigValue($uid, $cat, $k, $config['v']);
} else {
self::getApp()->deletePConfigValue($uid, $cat, $k);
self::getApp()->setPConfigValue($uid, $cat, $k, $config['v']);
} else {
self::getApp()->deletePConfigValue($uid, $cat, $k);
public function set($uid, $cat, $k, $value)
{
public function set($uid, $cat, $k, $value)
{
// We store our setting values as strings.
// So we have to do the conversion here so that the compare below works.
// The exception are array values.
// We store our setting values as strings.
// So we have to do the conversion here so that the compare below works.
// The exception are array values.
- $result = dba::update('pconfig', ['v' => $dbvalue], ['uid' => $uid, 'cat' => $cat, 'k' => $k], true);
+ $result = DBA::update('pconfig', ['v' => $dbvalue], ['uid' => $uid, 'cat' => $cat, 'k' => $k], true);
- $result = dba::delete('pconfig', ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
+ $result = DBA::delete('pconfig', ['uid' => $uid, 'cat' => $cat, 'k' => $k]);