protected function get_profile_keys($fetchall = false) {
        $keys = array_keys(get_object_vars($this->config));
        $updatekeys = [];
        foreach ($keys as $key) {
            if (preg_match('/^field_updatelocal_(.+)$/', $key, $match)) {
                // If we have a field to update it from and it must be updated 'onlogin' we update it on cron.
                if (!empty($this->config->{'field_map_'.$match[1]})) {
                    if ($fetchall || $this->config->{$match[0]} === 'onlogin') {
                        array_push($updatekeys, $match[1]); // the actual key name
                    }
                }
            }
        }

        if ($this->config->suspended_attribute && $this->config->sync_suspended) {
            $updatekeys[] = 'suspended';
        }

        return $updatekeys;
    }