Class

InterestKeywordCollection

InterestKeywordCollection()

Mapping between interests and keywords.

Constructor

# new InterestKeywordCollection()

Creates the InterestKeywordCollection.

View Source api/interest/InterestKeywordCollection.ts, line 10

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/interest/InterestKeywordCollection.ts, line 107

If there is no logged in user, or the user is not an Admin or Advisor.

Meteor.Error

# checkIntegrity() → {Array.<any>}

Checks the interestIDs.

View Source api/interest/InterestKeywordCollection.ts, line 114

Array.<any>

# define(interest, keyword, retired) → {string}

Defines a new interest keyword mapping.

Parameters:
Name Type Description
interest string

the interest slug or id.

keyword string

the keyword.

retired boolean | undefined

optional.

View Source api/interest/InterestKeywordCollection.ts, line 26

string

# dumpOne(docID) → {InterestKeywordDefine}

Returns an object for the InterestKeyword docID in a format acceptable to define().

Parameters:
Name Type Description
docID

the id of the pair.

View Source api/interest/InterestKeywordCollection.ts, line 128

InterestKeywordDefine

# getInterestSlugs(keyword) → {Array.<string>}

Returns the interest slugs associated with the given keyword.

Parameters:
Name Type Description
keyword string

the keyword.

View Source api/interest/InterestKeywordCollection.ts, line 97

the interest slugs.

Array.<string>

# getKeywords(interest) → {Array.<string>}

Returns the keywords associated with the give interest.

Parameters:
Name Type Description
interest

the interest slug or id.

View Source api/interest/InterestKeywordCollection.ts, line 80

Array.<string>

# getUniqueKeywords() → {Array.<string>}

Returns the unique keywords in this collection.

View Source api/interest/InterestKeywordCollection.ts, line 88

Array.<string>

# removeInterest(interest)

Removes all the pairs for the given interest.

Parameters:
Name Type Description
interest string

the interest slug or id.

View Source api/interest/InterestKeywordCollection.ts, line 64

# removeIt(docID) → {boolean}

Removes the pair.

Parameters:
Name Type Description
docID string

the id of the pair.

View Source api/interest/InterestKeywordCollection.ts, line 56

boolean

# removeKeyword(keyword)

Removes all the pairs for the given keyword.

Parameters:
Name Type Description
keyword string

the keyword.

View Source api/interest/InterestKeywordCollection.ts, line 72

# update(docID, keyword, retired)

Updates the given interest keyword pair.

Parameters:
Name Type Description
docID

the id of the pair.

keyword string | undefined

the new keyword, optional.

retired boolean | undefined

the retired status, optional.

View Source api/interest/InterestKeywordCollection.ts, line 40