Methods
(async, inner) addNewCourse(course)
Add a new course: insert new course object to the database,
and immediately attempt to update the cache with the new object.
The course object is only cached if it can successfully be updated
from the LinkedIn Learning API.
Parameters:
Name | Type | Description |
---|---|---|
course |
Object |
- Source:
(async, inner) deleteCourse(id)
Delete a course from the database and efficiently remove it
from the cache so full flushing of cache can be avoided.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
- Source:
(async, inner) fetchAll()
Fetch call courses.
Fetches from cache if possible, otherwise
fetches from database and caches values
for future use.
- Source:
(async, inner) fetchAllWithUniqueTitles() → {Array}
Fetch all courses that have unique titles.
Fetches all courses then filters and sorts
by the titles.
- Source:
Returns:
courses
- Type
- Array
(async, inner) fetchAndResolveCourse(courseId) → {Object}
Fetches all info related to course and resolves
all identifiers to values in the database.
Returns resolved course object.
Parameters:
Name | Type | Description |
---|---|---|
courseId |
Number |
- Source:
Returns:
course
- Type
- Object
(async, inner) fetchByFilters(filters) → {Array}
Fetch courses based on input filters.
Fetches from cache if possible
Parameters:
Name | Type | Description |
---|---|---|
filters |
Object |
- Source:
Returns:
matching course objects
- Type
- Array
(async, inner) fetchSimilarCourseRecords(course, maximumopt) → {Array}
Fetch similar course records by provided course and course-phase
records. If the provided course has multiple phases, one is picked
to avoid duplicate results.
Returns an array of course records with a default maximum size of 5.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
course |
Object | |||
maximum |
Number |
<optional> |
5 | default is 5 |
- Source:
Returns:
similar course records
- Type
- Array
(async, inner) updateCourse(course)
Update a course: update a stored course object in the database,
and immediately attempt to update the cache with the object.
The course object is only cached if it can successfully be updated
from the LinkedIn Learning API.
Parameters:
Name | Type | Description |
---|---|---|
course |
Object |
- Source: