Data block. You can get or create it through the BlockManager API. Data blocks are described in detail in Data Blocks article.

Methods

get (group:String, key:String):Null<Dynamic>

Returns block attribute value.

If group is null, return block row attribute.

Parameters:

group

Attribute group. Will get the nested attribute params.group.key.

key

Attribute name.

Returns:

Attribute value. Returns null if the attribute is not found.

getBool (group:String, key:String):Bool

Returns block attribute value as Bool.

If group is null, return block row attribute.

Parameters:

group

Attribute group. Will get the nested attribute params.group.key.

key

Attribute name.

Returns:

Attribute value. Returns false if the attribute is not found.

getFloat (group:String, key:String):Float

Returns block attribute value as Float.

If group is null, return block row attribute.

Parameters:

group

Attribute group. Will get the nested attribute params.group.key.

key

Attribute name.

Returns:

Attribute value. Returns 0 if the attribute is not found.

getInt (group:String, key:String):Int

Returns block attribute value as Int.

If group is null, return block row attribute.

Parameters:

group

Attribute group. Will get the nested attribute params.group.key.

key

Attribute name.

Returns:

Attribute value. Returns 0 if the attribute is not found.

inline getList ():Map<String, Dynamic>

Returns the raw Map of block contents.

Returns:

Map of block contents.

getListCopy ():Map<String, Dynamic>

Returns a copy of the raw Map of block contents.

Returns:

A copy of the Map of block contents.

inline getString (group:String, key:String):String

Returns block attribute value as String.

If group is null, return block row attribute.

Parameters:

group

Attribute group. Will get the nested attribute params.group.key.

key

Attribute name.

Returns:

Attribute value. Returns null if the attribute is not found.

set (group:String, key:String, val:Dynamic):Void

Sets block attribute value and increases version number. You will still need to call CacheManager.updated() to mark the block for saving.

Parameters:

group

Attribute group. Can be one of the following: null - Database row attribute. <group> - Will set the following attribute: params.<group>.<key>. If the group does not exist, will initialize it.

key

Attribute name. Supports the following naming scheme for setting array elements: "$". In this case array element with index "index" will be set to the given value.

val

Attribute value.

inline updated ():Void

Marks this block as updated. This method needs to be called if block contents were changed manually instead of using set().