Records Meta Data
Records Meta Data Methods
Records components provide a few methods to describe the component itself.
getFieldsStruct
The "getFieldsStruct" method returns a structure of all of the fields in the Records component (including relation fields). Each key of the structure is the name of a field and each one holds a structure representing the attributes of that field.
The method takes one argument "transformer" and adjusts the values returned for values of "sebField" or "sebColumn". It could, of course, be extended to do more as well.
This is also used by SebTags.
getFieldsArray
The "getFieldsStruct" method returns an array of all of the fields in the Records component (including relation fields). The array is in the order in which the fields are defined internally. Each item of the array holds a structure representing the attributes of that field.
The method takes one argument "transformer" and adjusts the values returned for values of "sebField" or "sebColumn". It could, of course, be extended to do more as well.
This is also used by SebTags.
getMetaStruct
The "getMetaStruct" returns a structure of information about the Records component.
- field_label (optional): The name of the label field for the component (if one exists).
- entity (optional): The "entity" value for the data set (if one exists).
- entities (optional): A pluralization of the entity attribute (it it exists).
- label_Singular: The singular label for the data set.
- label_Plural: The plural label for the data set.
- method_Singular: The suffix for singular methods (like getRecord, saveRecord, copyRecord, validateRecord)
- method_Plural: The suffix for plural methods (like getRecords, sortRecords))
- method_copy: The name of the named "copyRecord" method.
- method_get: The name of the named "copyRecord" method.
- method_gets: The name of the named "getRecords" method.
- method_remove: The name of the named "remoteRecord" method.
- method_save: The name of the named "saveRecord" method.
- method_sort: The name of the named "sortRecords" method.
- method_delete: The name of the named "removeRecord" method.
- method_validate: The name of the named "validateRecord" method.
- property_deletable: The "deletable" property. May be a boolean to indicate if all records are deletable or the name of a boolean field that will hold this value (possibly prefixed with "!" to indicate the need to negate the value first).
- property_hidecols: Always returns true (more on this later).
- property_pktype: The field type of the primary key field for the data set.
- message_save: The message that should be sent to the user by any code after it calls the saveRecord method (defaults to "#labelSingular# Saved.")
- message_remove: The message that should be sent to the user by any code after it calls the remoteRecord method (defaults to "#labelSingular# Deleted.")
- message_sort: The message that should be sent to the user by any code after it calls the sortRecords method (defaults to "#labelPlural# Sorted.")
- arg_sort: The name of the list argument for sortRecords (defaults to "#methodPlural#")
- catch_types: A list of exception types that should be treated as validation errors specific to this component.
- pkfields: A list of primary key field names for the component.
- arg_pk: Returned only if the component has only one primary key field. The name of the primary key field.
This is also used by SebTags.