Class: TermController

controllers~TermController()

Class representing a term controller.

Constructor

new TermController()

Create a term controller.
Source:

Methods

(async) byId(id) → {Promise:.<object:>}

Get an term by id.
Parameters:
Name Type Description
id number
Source:
Returns:
Type
Promise:.<object:>

(async) byTermText(term) → {Promise:.<object:>}

Get an term by the term's text.
Parameters:
Name Type Description
term string
Source:
Returns:
Type
Promise:.<object:>

(async) insert(term) → {Promise:.<object:>}

Insert a term.
Parameters:
Name Type Description
term string
Source:
Returns:
Type
Promise:.<object:>

(async) insertMany(terms) → {Promise:.<Array:.<number:>>}

Insert many terms.
Parameters:
Name Type Description
terms Array:.<string:>
Source:
Returns:
Type
Promise:.<Array:.<number:>>

(async) linkTermBook(termId, bookId) → {Promise:.<void:>}

Link a term to a book.
Parameters:
Name Type Description
termId number
bookId number
Source:
Returns:
Type
Promise:.<void:>