User Tools

Site Tools


type_class

This is an old revision of the document!


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 typestring
Javascript typestring
SQL fieldMEDIUMTEXT
Can be nullNo
Form fieldTextareaField class
Visualhtml entity encoded and line breaks replaced with <br>

This object is used for storing large text segments of unformatted text.

BoolType

PHP typebool
Javascript typebool
SQL fieldTINYINT(1)
Can be nullNo
Form fieldCheckboxField class
VisualYes or no

Advanced types

ArrayType

PHP typearray
Javascript typearray
SQL fieldMEDIUMTEXT containing json array
Can be nullYes
Form fieldMultiplierSection class or MultiField class
VisualEither 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 typearray
Javascript typeobject
SQL fieldnone
Can be nullYes
Form fieldCurrencyField class
VisualValue 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.

type_class.1707919422.txt.gz · Last modified: 2024/02/14 14:03 by sahl

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki