Class

ProfileInterestCollection

ProfileInterestCollection()

Constructor

# new ProfileInterestCollection()

Creates the ProfileInterest collection

View Source api/user/profile-entries/ProfileInterestCollection.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/ProfileInterestCollection.ts, line 96

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/user/profile-entries/ProfileInterestCollection.ts, line 147

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

Array

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

Defines a new ProfileInterest.

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/user/profile-entries/ProfileInterestCollection.ts, line 27

void | * | boolean | Object

# dumpOne(docID) → {ProfileInterestDefine}

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

Parameters:
Name Type Description
docID

the docID of a ProfileInterest

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 165

ProfileInterestDefine

# getInterestDoc(instanceID) → {Object}

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

Parameters:
Name Type Description
instanceID

The id of the InterestInstance.

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 105

If instanceID is not a valid ID.

Meteor.Error

The associated Interest.

Object

# getInterestSlug(instanceID) → {string}

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

Parameters:
Name Type Description
instanceID

The ProfileInterest ID.

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 115

The interest slug.

string

# getStudentDoc(instanceID) → {Object}

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

Parameters:
Name Type Description
instanceID

The ID of the ProfileInterest.

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 126

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

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 136

*

# publish()

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

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 74

# removeIt(docID)

Remove the ProfileInterest.

Parameters:
Name Type Description
docID

The docID of the ProfileInterest.

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 56

# removeUser(user)

Removes all the ProfileInterests for the user.

Parameters:
Name Type Description
user

the username.

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 65

# update(docID, retired)

Updates the retired status.

Parameters:
Name Type Description
docID

the ID of the ProfileInterest.

retired

the new retired value.

View Source api/user/profile-entries/ProfileInterestCollection.ts, line 41