Class

ProfileOpportunityCollection

ProfileOpportunityCollection()

Constructor

# new ProfileOpportunityCollection()

Creates the ProfileOpportunity collection

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

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

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

Array

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

Defines a new ProfileOpportunity.

Parameters:
Name Type Description
opportunity

the opportunity slug.

student

the student's username.

retired

the retired status.

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

void | * | boolean | Object

# dumpOne(docID) → {Object}

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

Parameters:
Name Type Description
docID

The docID of a ProfileOpportunity.

View Source api/user/profile-entries/ProfileOpportunityCollection.ts, line 160

An object representing the definition of docID.

Object

# getOpportunityDoc(instanceID) → {Object}

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

Parameters:
Name Type Description
instanceID

The id of the OpportunityInstance.

View Source api/user/profile-entries/ProfileOpportunityCollection.ts, line 100

If instanceID is not a valid ID.

Meteor.Error

The associated Opportunity.

Object

# getOpportunitySlug(instanceID) → {string}

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

Parameters:
Name Type Description
instanceID

The ProfileOpportunity ID.

View Source api/user/profile-entries/ProfileOpportunityCollection.ts, line 110

The opportunity slug.

string

# getStudentDoc(instanceID) → {Object}

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

Parameters:
Name Type Description
instanceID

The ID of the ProfileOpportunity.

View Source api/user/profile-entries/ProfileOpportunityCollection.ts, line 121

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

View Source api/user/profile-entries/ProfileOpportunityCollection.ts, line 131

*

# publish()

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

View Source api/user/profile-entries/ProfileOpportunityCollection.ts, line 69

# removeIt(docID)

Remove the ProfileOpportunity.

Parameters:
Name Type Description
docID

The docID of the ProfileOpportunity.

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

# removeUser(user)

Removes all the ProfileOpportunities for the user.

Parameters:
Name Type Description
user

the username.

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

# update(docID, retired)

Updates the retired status.

Parameters:
Name Type Description
docID

the ID of the ProfileOpportunity.

retired

the new retired value.

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