Class

FavoriteOpportunityCollection

FavoriteOpportunityCollection()

Constructor

# new FavoriteOpportunityCollection()

Creates the FavoriteOpportunity collection

View Source api/favorite/FavoriteOpportunityCollection.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/FavoriteOpportunityCollection.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, opportunityID, and studentID.

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

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

Array

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

Defines a new FavoriteOpportunity.

Parameters:
Name Type Description
opportunity

the opportunity slug.

student

the student's username.

retired

the retired status.

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

void | * | boolean | Object

# dumpOne(docID) → {Object}

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

Parameters:
Name Type Description
docID

The docID of a FavoriteOpportunity.

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

An object representing the definition of docID.

Object

# getOpportunityDoc(instanceID) → {Object}

Returns the Opportunity associated with the FavoriteOpportunity with the given instanceID.

Parameters:
Name Type Description
instanceID

The id of the OpportunityInstance.

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

If instanceID is not a valid ID.

Meteor.Error

The associated Opportunity.

Object

# getOpportunitySlug(instanceID) → {string}

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

Parameters:
Name Type Description
instanceID

The FavoriteOpportunity ID.

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

The opportunity slug.

string

# getStudentDoc(instanceID) → {Object}

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

Parameters:
Name Type Description
instanceID

The ID of the FavoriteOpportunity.

View Source api/favorite/FavoriteOpportunityCollection.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 FavoriteOpportunity id.

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

*

# publish()

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

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

# removeIt(docID)

Remove the FavoriteOpportunity.

Parameters:
Name Type Description
docID

The docID of the FavoriteOpportunity.

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

# removeUser(user)

Removes all the FavoriteOpportunities for the user.

Parameters:
Name Type Description
user

the username.

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

# update(docID, retired)

Updates the retired status.

Parameters:
Name Type Description
docID

the ID of the FavoriteOpportunity.

retired

the new retired value.

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