ccrz.cc_hk_Category.fetch
Defines legacy behavior for calling the ccrz.ccApiPublicCache.fetch method for returning the cached category tree
data.
Compatibility
This class is deprecated. For existing extensions of this class, the managed package provides an example class, ccrz.ccLogicCategoryGetTreeHk, that extends the default ccrz.ccLogicCategoryGetTree logic service provider to reference methods of this class.
Signature
global virtual Map<String, Object> fetch(Map<String, Object>)
Inputs (Optional)
Map<String, Object> that can include the following keys:
- ccrz.cc_hk_Category.PARAM_CATEGORY_ID
- String that specifies the 18-digit Salesforce ID of a category to fetch subcategories for.
Outputs
Map<String, Object> that can include the following keys:
- ccrz.cc_hk_Category.PARAM_CATEGORIES
- List<Object> of the cached category tree data, deserialized from the ccrz.ccApiPublicCache.CONTENT output of ccrz.ccApiPublicCache.fetch.
- ccrz.cc_hk_Category.PRAM_SUB_CAT
- List<ccrz__E_Category__c> of one level of subcategories for the specified ccrz.cc_hk_Payment.PARAM_CATEGORY_ID.
Example
Override the default ccrz.cc_hk_Category.fetch method to rename the top-level categories.
global virtual override Map<String, Object> fetch(Map<String, Object> inputData {
Map<String, Object> defaultFetchResults = super.fetch(inputData);
List<Object> categories = (List<Object>)defaultFetchResults.get(PARAM_CATEGORIES);
for(Object category:categoryTree) {
Map<String, Object> categoryMap = (Map<String,Object>)category;
categoryMap.put('name', 'stringToRename' + categoryMap.get('name'));
}
return getTreeResults;
}