Database

Database

A class that handles fetching and storing data for a resort/park

Constructor

new Database(options)

Description:
  • Construct a new Database object
Source:
Parameters:
Name Type Description
options object

Classes

Database

Methods

(async, abstract) _getEntities() → {array.<object>}

Description:
  • Return all entities for this resort/park
Source:
Returns:
Type
array.<object>

(async, abstract) _init()

Description:
  • Internal init function, override this in child classes for functionality
Source:

(async) findEntity(filteropt)

Description:
  • Find a single entity from this database
Source:
Parameters:
Name Type Attributes Description
filter object <optional>

(async) getEntities(filteropt)

Description:
  • Get entities from this database. Optionally filtering by some conditions
Source:
Parameters:
Name Type Attributes Description
filter object <optional>

(async) getEntitiyById(entityId)

Description:
  • Get an entity object from it's ID
Source:
Parameters:
Name Type Description
entityId string Entity ID

(async) init()

Description:
  • Initialise this database object
Source:

log()

Description:
  • Pretty print log for this database
Source:

(static) get(optionsopt) → {Database}

Description:
  • Get singleton of this class type
Source:
Parameters:
Name Type Attributes Description
options object <optional>
Options to pass to new instance. Will only be used if the instance doesn't already exist
Returns:
Type
Database