Scope

flitter-orm/src/model/Scope~ Scope

Base class for a filter scope to apply to a model.


Constructor

new Scope(config)

Load in the scope config.

Parameters:
Name Type Description
config object

Extends

Members

(private) _di_allow_defer :boolean

If true, the injector will defer the class if the class requests any services that the container is missing. These services are filled in later and added to the prototype and any instances. True by default.

Type:
  • boolean

(private) _di_deferred_instances :Array.<module:flitter-di/src/Injectable~Injectable>

Collection of instances of this class that need to have the deferred service instances injected into them when the deferred services are finally provided.

(private) _di_deferred_services :Array.<string>

List of services that were deferred and not provided at the time of injection.

Type:
  • Array.<string>

config :Object

The scope config.

Type:
  • Object

Methods

(async) filter(to_filter) → {Promise.<module:flitter-orm/src/filter/Filter~Filter>}

Apply the scope to the filter.

Parameters:
Name Type Description
to_filter module:flitter-orm/src/filter/Filter~Filter

the Filter to modify

(async) save(record) → {Promise.<object>}

Make modifications to the record before it is saved in the database.

Parameters:
Name Type Description
record object
Returns:
Type
Promise.<object>