The AbstractModel class holds all the method for the basic model. By default no states are set.

Extends ObjectManager

Methods

_getComponentConfig (identifier, config)

private

The _getComponentConfig is an internal method to combine all the config object together. Usually you don't have to call this method manually.

Parameters

Name Type Description
identifier Identifier The identifier object of the object to load.
config Object The config object for the object to load.

Returned Value

Object: The complete and combined config object.


_initialize (config)

private

The abstract initialize method sets the config, and when behaviors are added it will allocate them.

Parameters

Name Type Description
config Object the config for this object

Returned Value

Promise: A promise containing the initialized object.


clone ()

The clone method will return a clone of the current object. The clone is going exactly 4 levels deep.

Returned Value

Object: The cloned object.


execute (method, context)

The execute method executes a method against the command chain.

Parameters

Name Type Description
method Object The method to execute
context Object A simple object to act as the basic context.

Returned Value

Promise: A promise containing the context with the result of the call.


getCommandChain ()

The getCommandChain will return the command chain for the current object.

Returned Value

CommandChain: The command chain object.


getIdentifier ()

The getIdentifier method will return the identifier for the current object.

Returned Value

Identifier: The identifier object from Raddish-Loader


getItem ()

The getItem method will return a single item from the data layer. By default an empty Row object is returned.

Returned Value

Promise: A promise contianing an empty Row object.


getList ()

The getList method will return by default an empty Rowset object.

Returned Value

Promise: A promise containing an empty Rowset object.


getObject (identifier, config)

The getObject method will try to load the specified identifier. An optional config can be given for the identifier to load.

Parameters

Name Type Description
identifier String|Identifier An identifier string/ object.
config Object An optional config object.

Returned Value

Promise: A promise containing the initialized object.


getTable ()

This method will return the table related to the model.

Returned Value

Promise: A promise containing the table object.


setState (key, value)

This method will set the states of the model.

Parameters

Name Type Description
key String| Object The state name/ object of states to set.
value * The value for the state.

Returned Value

AbstractModel: The current model object for chaining.