Class

ProfileCourseCollection

ProfileCourseCollection()

Constructor

# new ProfileCourseCollection()

Creates the ProfileCourse collection

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 11

Methods

# assertValidRoleForMethod(userId)

Implementation of assertValidRoleForMethod. Asserts that userId is logged in as an Admin, Advisor or Student. This is used in the define, update, and removeIt Meteor methods associated with each class.

Parameters:
Name Type Description
userId

The userId of the logged in user. Can be null or undefined

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 90

If there is no logged in user, or the user is not an Admin or Advisor.

Meteor.Error

# checkIntegrity() → {Array}

Returns an array of strings, each one representing an integrity problem with this collection. Returns an empty array if no problems were found. Checks semesterID, courseID, and userID.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 151

A (possibly empty) array of strings indicating integrity issues.

Array

# define(course, username, retired) → {void|*|boolean|Object}

Defines a new ProfileCourse.

Parameters:
Name Type Description
course

the course slug.

username

the student's username.

retired

the retired status.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 25

void | * | boolean | Object

# dumpOne(docID) → {Object}

Returns an object representing the ProfileCourse docID in a format acceptable to define().

Parameters:
Name Type Description
docID

The docID of a ProfileCourse.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 169

An object representing the definition of docID.

Object

# dumpUser(usernameOrID) → {Array.<ProfileCourseDefine>}

Dumps all the ProfileCourses for the given usernameOrID.

Parameters:
Name Type Description
usernameOrID string

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 181

Array.<ProfileCourseDefine>

# getCourseDoc(instanceID) → {Object}

Returns the Course associated with the ProfileCourse with the given instanceID.

Parameters:
Name Type Description
instanceID

The id of the CourseInstance.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 99

If instanceID is not a valid ID.

Meteor.Error

The associated Course.

Object

# getCourseSlug(instanceID) → {string}

Returns the Course slug for the profile's corresponding Course.

Parameters:
Name Type Description
instanceID

The ProfileCourse ID.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 109

The course slug.

string

# getCourseSlugs(username) → {Array.<any>}

Returns the list of non-retired Course slugs associated with this username.

Parameters:
Name Type Description
username

The username

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 119

Interest slugs.

Array.<any>

# getStudentDoc(instanceID) → {Object}

Returns the Student profile associated with the ProfileCourse with the given instanceID.

Parameters:
Name Type Description
instanceID

The ID of the ProfileCourse.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 130

If instanceID is not a valid ID.

Meteor.Error

The associated Student profile.

Object

# getStudentUsername(instanceID) → {*}

Returns the username associated with the userID.

Parameters:
Name Type Description
instanceID

the ProfileCourse id.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 140

*

# publish()

Publish ProfileCourses. If logged in as ADMIN get all, otherwise only get the ProfileCourses for the userID. Also publishes the ProfileCourses forecast.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 68

# removeIt(docID)

Remove the ProfileCourse.

Parameters:
Name Type Description
docID

The docID of the ProfileCourse.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 51

# removeUser(user)

Removes all the ProfileCourses for the user.

Parameters:
Name Type Description
user

the username.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 60

# update(docID, retired)

Updates the retired status.

Parameters:
Name Type Description
docID

the ID of the ProfileCourse.

retired

the new retired value.

View Source api/user/profile-entries/ProfileCourseCollection.ts, line 39