Class

FavoriteAcademicPlanCollection

FavoriteAcademicPlanCollection()

Constructor

# new FavoriteAcademicPlanCollection()

Creates the FavoriteAcademicPlan collection

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 12

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/favorite/FavoriteAcademicPlanCollection.ts, line 106

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, academicPlanID, and studentID.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 157

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

Array

# define(academicPlan, student, retired) → {void|*|boolean|Object}

Defines a new FavoriteAcademicPlan.

Parameters:
Name Type Description
academicPlan

the academicPlan slug.

student

the student's username.

retired

the retired status.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 29

void | * | boolean | Object

# dumpOne(docID) → {Object}

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

Parameters:
Name Type Description
docID

The docID of a FavoriteAcademicPlan.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 175

An object representing the definition of docID.

Object

# getAcademicPlanDoc(instanceID) → {Object}

Returns the AcademicPlan associated with the FavoriteAcademicPlan with the given instanceID.

Parameters:
Name Type Description
instanceID

The id of the AcademicPlanInstance.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 115

If instanceID is not a valid ID.

Meteor.Error

The associated AcademicPlan.

Object

# getAcademicPlanSlug(instanceID) → {string}

Returns the AcademicPlan slug for the favorite's corresponding AcademicPlan.

Parameters:
Name Type Description
instanceID

The FavoriteAcademicPlan ID.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 125

The academicPlan slug.

string

# getStudentDoc(instanceID) → {Object}

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

Parameters:
Name Type Description
instanceID

The ID of the FavoriteAcademicPlan.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 136

If instanceID is not a valid ID.

Meteor.Error

The associated Student profile.

Object

# getStudentUsername(instanceID) → {*}

Returns the username associated with the studentID.

Parameters:
Name Type Description
instanceID

the FavoriteAcademicPlan id.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 146

*

# publish()

Publish AcademicPlanFavorites. If logged in as ADMIN get all, otherwise only get the AcademicPlanFavorites for the studentID. Also publishes the AcademicPlanFavorites scoreboard.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 73

# removeIt(docID)

Remove the FavoriteAcademicPlan.

Parameters:
Name Type Description
docID

The docID of the FavoriteAcademicPlan.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 55

# removeUser(user)

Removes all the FavoriteAcademicPlans for the user.

Parameters:
Name Type Description
user

the username.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 64

# update(docID, retired)

Updates the retired status.

Parameters:
Name Type Description
docID

the ID of the FavoriteAcademicPlan.

retired

the new retired value.

View Source api/favorite/FavoriteAcademicPlanCollection.ts, line 43