BaseDict Class
dictionary-structured data model
Methods
contains
-
item
check if the model contains the given submodel or not
Parameters:
-
itemBaseModel
Returns:
containsEntity
()
Boolean
public
static
returns item is Entity
Returns:
emitLoaded
()
private
tell listeners emit loaded
get
-
key
return submodel of the given key
Parameters:
-
keyString | Number
Returns:
getAnonymousClass
-
itemModelName
creates child class of BaseDict
Parameters:
-
itemModelNameString
Returns:
child class of BaseDict
getPropInfo
()
PropInfo
public
get an instance of PropInfo, which summarizes properties of this class
Returns:
has
-
key
check if the model has submodel of the given key or not
Parameters:
-
keyString | Number
Returns:
include
-
[options]
include all relational models if not set
Parameters:
-
[options]Object optional-
[recursive]Boolean optionalrecursively include models or not
-
Returns:
self
inherit
-
anotherModel
inherit value of anotherModel
Parameters:
-
anotherModelBaseModel
Returns:
this
key
()
protected
static
get unique key from item
on
()
public
on addEventlisteners for 'loaded'
remove
-
item
remove submodel from items both acceptable, keys and submodels
Parameters:
-
itemBaseModel | String | Number
setEntityProp
-
prop -
submodel
set related model(s)
Parameters:
-
propStringproperty name of the related model
-
submodelEntity | Array
Returns:
this
setIds
-
ids
set ids.
Parameters:
-
idsArray(String | Number)
setItems
-
models
set items from dic object update to new key
Parameters:
-
modelsObject | Array
toArray
()
public
export models to Array
toPlainObject
()
Object
create plain dict. if this dict contains entities, returns their ids if this dict contains non-entity models, returns their plain objects
Returns:
plainObject
Properties
ids
Array
public
ids: get ids of items
itemModelName
String
protected
static
model name of the item
items
Objects
items: dictionary of keys - models
loaded
Boolean
loaded: is data loaded or not
