TaxonomyProvider
Summary
Defines a TaxonomyProvider to get and save taxonomies.
Constructor
TaxonomyProvider
Syntax
TaxonomyProvider
(
-
database
Summary
Parameters:
-
database
DatabaseThe database to interact with
Item Index
Methods
Methods
add
Syntax
add
(
async
-
taxonomies
-
[callback]
Summary
Adds taxonomies.
Parameters:
-
taxonomies
ArrayThe list of taxonomies to store with for each taxonomy:
- String name The taxonomy name
- Array tree The list of terms in the taxonomy with for each term:
- String id Term id
- String title Term title
- Array items Term sub terms
- String id The taxonomy id, generated if not specified
-
[callback]
Function optionalThe function to call when it's done
- Error The error if an error occurred, null otherwise
- Number The total amount of taxonomies inserted
- Array The list of added taxonomies
createIndexes
Syntax
createIndexes
(
async
-
callback
Summary
Creates taxonomies indexes.
Parameters:
-
callback
FunctionFunction to call when it's done with :
- Error An error if something went wrong, null otherwise
getTaxonomyTerms
Syntax
getTaxonomyTerms
(
async
-
name
-
callback
Summary
Gets the list of terms of a taxonomy.
updateOne
Syntax
updateOne
(
async
-
[filter]
-
data
-
[callback]
Summary
Updates a taxonomy.