$prefs = is_object($this->preferences) ? json_decode(json_encode($this->preferences), true) : $this->preferences;