TableField

Field schema

Returns madTableField object, which contains the information of field schema. Many of Field methods are bridget to this class.

Object can be created through:
Table->getField(name)
Field->getTableField()

Arguments

$table
Table id or name
$field
Field id or name

Get Field object

$Field = $this->get('field', 'order', 'customer');
$Field = $this->get('field', 'order.customer');

Table->Field

First get the Table -object, then Field object:

$Field = $this->get('table', 'order')->getField('customer');

Pages->Page->Field

Get Field -object from Field- -object:

$Field = $Order->customer->getTableField();

Full method list

Field information

Method Return type Description
getId() int Unique ID -number.
getName() string Technical name.
getTitle() string Visible name.
getType() string Field type.
getIconUrl() string Fieldtype icon url.
getDescription() string Longer description.
getHelp() string Text that is show for end user in input.
getDocumentation() string Documentation text.
getPrivilege() string Users table privilege.
getPreferences() array Table preferences.
getPreference('$name/$subname') mixed Table preference by given name.
getTable() Table Table field belongs to.
getTblName() string Field name to use in SQL query: tablename.fieldname
getTblJoinClause([alias,on]) string Return SQL join clause: LEFT JOIN fieldTable->targetTable. Alias default: table name.
isPrivilege(level) bool Return TRUE, if user has given privilege to field.
isEditable() bool Return TRUE, if field can be edited by user and user has privilege to it.
isType(type[,type]) bool Return TRUE, if field type is any of given parameter. (fin or eng)
isFixed() bool Return TRUE, if field is fixed (created_at, created_by..)
isReference() bool Return TRUE, if field is a reference to another table.
getReferenceTable() Table Return Table the field refers to.

Field decorators

Decorators are subclasses that add funcionality to table.

Method Return type Description
getDecorator(name) eTableDecorator Load field decorator object.