This is an old revision of the document!
Table of Contents
Type Class
The type class is used to describe data types for Datarecord objects. Platform has a large number of builtin types.
Basic types
BigTextType
PHP type | string |
---|---|
Javascript type | string |
SQL field | MEDIUMTEXT |
Can be null | No |
Form field | TextareaField class |
Visual | html entity encoded and line breaks replaced with <br> |
This object is used for storing large text segments of unformatted text.
BoolType
PHP type | bool |
---|---|
Javascript type | bool |
SQL field | TINYINT(1) |
Can be null | No |
Form field | CheckboxField class |
Visual | Yes or no |
Advanced types
ArrayType
PHP type | array |
---|---|
Javascript type | array |
SQL field | MEDIUMTEXT containing json array |
Can be null | Yes |
Form field | MultiplierSection class or MultiField class |
Visual | Either a comma-separated range of values or no default view |
This type can be used in two ways. The default way will just store an array of strings and display a multiplier field where one can input one or more values.
For more complex usage it is also possible to define a more complex data structure, by adding a substructure to the type, which is an array of other types. The field will then hold an array of sub-objects defined by the substructure types and are also able to display a form for editing this substructure.
CurrencyType
PHP type | array |
---|---|
Javascript type | object |
SQL field | none |
Can be null | Yes |
Form field | CurrencyField class |
Visual | Value in foreign currency |
This field uses three sub fields localvalue (FloatType), currency (TextType) and foreignvalue (FloatType) where localvalue holds the value in local currency (which should be used for calculations etc), currency holds the currency abbreviation and foreignvalue holds the corresponding value in foreign currency. The PHP and javascript value are arrays/objects with element named in the same way.