protected function setCustomFields($base, $data, array $model_registry = array())
    {
        if (count($this->customfieldgroups) > 0) {
        } else {
            return $base;
        }

        foreach ($this->customfieldgroups as $group) {
            $group_data   = $this->processQueryFields(json_decode($data->$group), $model_registry [$group]);
            $base->$group = $this->sortObject($group_data);
        }

        return $base;
    }