*/
public function load(int $uid, string $cat = 'config')
{
- // If not connected, do nothing
- if (!$this->configModel->isConnected()) {
+ // If not connected or no uid, do nothing
+ if (!$uid || !$this->configModel->isConnected()) {
return;
}
*/
public function get(int $uid, string $cat, string $key, $default_value = null, bool $refresh = false)
{
+ if (!$uid) {
+ return $default_value;
+ }
+
// if the value isn't loaded or refresh is needed, load it to the cache
if ($this->configModel->isConnected() &&
(empty($this->db_loaded[$uid][$cat][$key]) ||
*/
public function set(int $uid, string $cat, string $key, $value)
{
+ if (!$uid) {
+ return false;
+ }
+
// set the cache first
$cached = $this->configCache->set($uid, $cat, $key, $value);
*/
public function delete(int $uid, string $cat, string $key)
{
+ if (!$uid) {
+ return false;
+ }
+
$cacheRemoved = $this->configCache->delete($uid, $cat, $key);
if (isset($this->db_loaded[$uid][$cat][$key])) {