Cache block. Data blocks are described in detail in Data Blocks article.

Fields

read only id:Int

Block id.

read only type:String

Block type.

read only version:Int

Block version.

Methods

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

Returns block attribute value.

Parameters:

group

Attribute group. Can be one of the following: null - Database row attribute. <group> - Will set the following attribute: params.<group>.<key>.

key

Attribute name.

Returns:

Attribute value. Returns null, if the attribute does not exist.

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

Returns block attribute value as Bool.

Parameters:

group

Attribute group. Can be one of the following: null - Database row attribute. <group> - Will set the following attribute: params.<group>.<key>.

key

Attribute name.

Returns:

Attribute value. Returns false, if the attribute does not exist.

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

Returns block attribute value as Float.

Parameters:

group

Attribute group. Can be one of the following: null - Database row attribute. <group> - Will set the following attribute: params.<group>.<key>.

key

Attribute name.

Returns:

Attribute value. Returns 0, if the attribute does not exist.

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

Returns block attribute value as Int.

Parameters:

group

Attribute group. Can be one of the following: null - Database row attribute. <group> - Will set the following attribute: params.<group>.<key>.

key

Attribute name.

Returns:

Attribute value. Returns 0, if the attribute does not exist.

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

Returns block attribute value as String.

Parameters:

group

Attribute group. Can be one of the following: null - Database row attribute. <group> - Will set the following attribute: params.<group>.<key>.

key

Attribute name.

Returns:

Attribute value. Returns null, if the attribute does not exist.

set (group:String, key:String, val:Dynamic, ?markAsUpdated:Bool):Void

Sets block attribute value and marks it as updated.

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.

val

Attribute value.

markAsUpdated

Is true by default. If true, will mark this attribute as updated. This attribute will be included in block diff sent to cache server later. This parameter is mainly needed when initializing lists. If another element is inserted into the newly initialized list in the same server tick the diff will not have this data duplicated, as a new list attribute and as a list[X] element.

updated (group:String, key:String, ?index:Int):Void

Marks block attribute as updated. If the block attribute is an array itself and index parameter is set the block diff will only contain updated array element, not the whole array.

Parameters:

group

Attribute group. Can be one of the following: null - Database row attribute. <group> - Will set the following attribute: params.<group>.<key>.

key

Attribute name.

index

Array index. Set only if the attribute is an array.