Class

FavoriteInterestCollection

FavoriteInterestCollection()

Constructor

# new FavoriteInterestCollection()

Creates the FavoriteInterest collection

View Source api/favorite/FavoriteInterestCollection.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/FavoriteInterestCollection.ts, line 116

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, interestID, and userID.

View Source api/favorite/FavoriteInterestCollection.ts, line 167

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

Array

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

Defines a new FavoriteInterest.

Parameters:
Name Type Description
interest

the interest slug.

student

the student's username.

share Boolean

, is the interest to be shared? Defaults to false.

retired

the retired status.

View Source api/favorite/FavoriteInterestCollection.ts, line 31

void | * | boolean | Object

# dumpOne(docID) → {IFavoriteInterestDefine}

Returns an object representing the FavoriteInterest with given docID in a format acceptable to define().

Parameters:
Name Type Description
docID

the docID of a FavoriteInterest

View Source api/favorite/FavoriteInterestCollection.ts, line 185

IFavoriteInterestDefine

# getInterestDoc(instanceID) → {Object}

Returns the Interest associated with the FavoriteInterest with the given instanceID.

Parameters:
Name Type Description
instanceID

The id of the InterestInstance.

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

If instanceID is not a valid ID.

Meteor.Error

The associated Interest.

Object

# getInterestSlug(instanceID) → {string}

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

Parameters:
Name Type Description
instanceID

The FavoriteInterest ID.

View Source api/favorite/FavoriteInterestCollection.ts, line 135

The interest slug.

string

# getStudentDoc(instanceID) → {Object}

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

Parameters:
Name Type Description
instanceID

The ID of the FavoriteInterest.

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

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 FavoriteInterest id.

View Source api/favorite/FavoriteInterestCollection.ts, line 156

*

# publish()

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

View Source api/favorite/FavoriteInterestCollection.ts, line 78

# removeIt(docID)

Remove the FavoriteInterest.

Parameters:
Name Type Description
docID

The docID of the FavoriteInterest.

View Source api/favorite/FavoriteInterestCollection.ts, line 60

# removeUser(user)

Removes all the FavoriteInterests for the user.

Parameters:
Name Type Description
user

the username.

View Source api/favorite/FavoriteInterestCollection.ts, line 69

# update(docID, retired)

Updates the retired status.

Parameters:
Name Type Description
docID

the ID of the FavoriteInterest.

retired

the new retired value.

View Source api/favorite/FavoriteInterestCollection.ts, line 45