RBO Fields

The previous page showed how to use RBO in your module, with two simple fields. RBO supports many more field types — you choose which ones to use in Recordset.php's fields() function. Below is the full list of available RBO field types.

Text

Holds a string value. HTML entities are escaped. The field's length must be defined.

$text = new RBO_Field_Text('<field_name>');
$text->set_length(24)->set_required()->set_visible();

Thanks to RBO's fluent interface, you can configure the field in one line: set_length($value) sets the text length, set_visible() makes the field appear, and set_required() makes Epesi refuse to save the record until the field is filled in.

Example:

$text = new RBO_Field_Text('Text');
$text->set_length(24)->set_required()->set_visible();

Long text

Holds a note (a longer string value). HTML entities are escaped, and BBCode is supported. Because attachments are added to nearly every recordset, this field's length is capped at 400 characters (not counting BBCode tags).

$long_text = new RBO_Field_LongText('<field_name>');
$long_text->set_visible();

Example:

$longtext = new RBO_Field_LongText('Longtext');
$longtext->set_visible();

Integer

Holds an integer value.

$int = new RBO_Field_Integer('<field_name>');
$int->set_visible();

Example:

$integer = new RBO_Field_Integer('Integer');
$integer->set_visible();

Autonumber

Creates a primary key for every new record.

$ID = new RBO_Field_Autonumber('<field_name>');
$ID->set_visible();

Example:

$ID = new RBO_Field_Autonumber('helloworldID');
//$ID->set_visible();

An autonumber field is a generated ID — it doesn't need to be visible, so leave set_visible() commented out.

Warning: do not name this field ID.

Float

Holds a float value.

$float = new RBO_Field_Float('<field_name>');
$float->set_visible();

Example:

$float = new RBO_Field_Float('float');
$float->set_visible();

Checkbox

Holds a boolean value: true for checked, or an empty string (the same empty value every field type uses) for unchecked.

$CB = new RBO_Field_Checkbox('<field_name>');
$CB->set_visible();

Example:

$CB = new RBO_Field_Checkbox('CB');
$CB->set_visible();

Calculated

A calculated field holds no value of its own — it's read-only, and exists to show the user derived information. Because of this, display_callback is a required property. If needed, its data type can be set via the param property; this value is usually modified from a processing callback.

$Calc = new RBO_Field_Calculated('<field_name>');
$Calc->set_visible();

Example:

$Calc = new RBO_Field_Calculated('Calc');
//$Calc->set_visible();

In order for this field to output a calculation, you must use the __display_magic_callback function. For example, say your calculated field is called calc, and you want to check whether someone checked cb — if so, return the sum of the integer field's value and 20.

The code example for this callback is missing from this page and needs to be re-added by someone with access to a working HelloWorld module — flagged during the August 2026 documentation review. In the meantime, see the RBO reference for the general field/callback pattern.