Module: category

Methods

(async, inner) fetchAll() → {Array}

Fetch all categories. If cached, return from cache, otherwise, fetch from database and cache the values.
Source:
Returns:
all category objects
Type
Array

(async, inner) fetchAllByParent(parentId) → {Array}

Fetch all categories based on input parent id. If categories are cached, return from cache, otherwise, fetch from database. A parent of a category refers to the higher level grouping: 'capabilities'.
Parameters:
Name Type Description
parentId Number
Source:
Returns:
matching category objects
Type
Array

(async, inner) fetchById(id) → {Object}

Fetch a category object by id from database.
Parameters:
Name Type Description
id Number
Source:
Returns:
category object
Type
Object

(async, inner) fetchByKeyword(keyword) → {Array}

Fetch categories based on input keyword. If categories are cached, return from cache, otherwise, fetch from database.
Parameters:
Name Type Description
keyword String
Source:
Returns:
matching category objects
Type
Array