modules/ModuleBuilder/parsers/StandardField.php
\StandardField
- Parent(s)
- \DynamicField
Properties

$base_path= '""'
""Details- Type
- n/a
- Inherited_from
- \DynamicField::$$base_path

$use_existing_labels= 'false'
falseDetails- Type
- n/a
- Inherited_from
- \DynamicField::$$use_existing_labels
Methods

DynamicField(
$module
=
''
)
:
void| Name | Type | Description |
|---|---|---|
| $module |

addField(
\unknown_type $name, \unknown_type $label
=
'', \unknown_type $type
=
'Text', \unknown_type $max_size
=
'255', \unknown_type $required_option
=
'optional', \unknown_type $default_value
=
'', \unknown_type $ext1
=
'', \unknown_type $ext2
=
'', \unknown_type $ext3
=
'', \unknown_type $audited
=
0, \unknown_type $mass_update
=
0, \unknown_type $ext4
=
'', \unknown_type $help
=
'', \unknown_type $duplicate_merge
=
0, \unknown_type $comment
=
''
)
:
boolean
Adds a Custom Field using parameters
| Name | Type | Description |
|---|---|---|
| $name | \unknown_type | |
| $label | \unknown_type | |
| $type | \unknown_type | |
| $max_size | \unknown_type | |
| $required_option | \unknown_type | |
| $default_value | \unknown_type | |
| $ext1 | \unknown_type | |
| $ext2 | \unknown_type | |
| $ext3 | \unknown_type | |
| $audited | \unknown_type | |
| $mass_update | \unknown_type | |
| $ext4 | \unknown_type | |
| $help | \unknown_type | |
| $duplicate_merge | \unknown_type | |
| $comment | \unknown_type |
| Type | Description |
|---|---|
| boolean |

addFieldObject(
\Field $field
)
:
booleanAdds a custom field using a field object
| Name | Type | Description |
|---|---|---|
| $field | \Field | Object $field |
| Type | Description |
|---|---|
| boolean |

addLabel(
string $displayLabel
)
:
stringAdds a label to the module's mod_strings for the current language Note that the system label name
Inherited from: \DynamicField::addLabel()| Name | Type | Description |
|---|---|---|
| $displayLabel | string | The label value to be displayed |
| Type | Description |
|---|---|
| string | The core of the system label name - returns currency_id5 for example, when the full label would then be LBL_CURRENCY_ID5 TODO: Only the core is returned for historical reasons - switch to return the real system label |

add_existing_custom_field(
$data, $execute
=
true
)
:
void| Name | Type | Description |
|---|---|---|
| $data | ||
| $execute |

add_existing_custom_fields(
$execute
=
true
)
:
voidUpdates the db schema and adds any custom fields we have used if the custom table was dropped
Inherited from: \DynamicField::add_existing_custom_fields()| Name | Type | Description |
|---|---|---|
| $execute |

buildCache(
STRING $module
=
false, boolean $saveCache
=
true
)
:
\unknownBuilds the cache for custom fields based on the vardefs
Inherited from: \DynamicField::buildCache()| Name | Type | Description |
|---|---|---|
| $module | STRING | |
| $saveCache | boolean | saveCache Boolean value indicating whether or not to pass saveCache value to saveToVardef, defaults to true |
| Type | Description |
|---|---|
| \unknown |

createCustomTable(
$execute
=
true
)
:
voidCreates the custom table with an id of id_c
Inherited from: \DynamicField::createCustomTable()| Name | Type | Description |
|---|---|---|
| $execute |

deleteField(
$widget
)
:
voidDeletes the field from fields_meta_data and drops the database column then it rebuilds the cache Use the widgets get_db_modify_alter_table() method to get the table sql - some widgets do not need any custom table modifications
Inherited from: \DynamicField::deleteField()| Name | Type | Description |
|---|---|---|
| $widget |

fieldExists(
$name
=
'', $type
=
''
)
:
void| Name | Type | Description |
|---|---|---|
| $name | ||
| $type |

fill_relationships(
)
:
voidFills in all the custom fields of type relate relationships for an object
Inherited from: \DynamicField::fill_relationships()
getAllFieldsView(
$view, $type
)
:
void| Name | Type | Description |
|---|---|---|
| $view | ||
| $type |

getDBName(
STRING $name, BOOLEAN $_C
=
true
)
:
STRING
| Name | Type | Description |
|---|---|---|
| $name | STRING | |
| $_C | BOOLEAN | do we append _c to the name |
| Type | Description |
|---|---|
| STRING |

getFieldWidget(
$module, $fieldName
)
:
voidReturns the widget for a custom field from the fields_meta_data table.
Inherited from: \DynamicField::getFieldWidget()| Name | Type | Description |
|---|---|---|
| $module | ||
| $fieldName |

getJOIN(
\$expandedList $expandedList
=
false, $includeRelates
=
false, $where
=
false
)
:
arrayreturns either false or an array containing the select and join parameter for a query using custom fields
Inherited from: \DynamicField::getJOIN()| Name | Type | Description |
|---|---|---|
| $expandedList | \$expandedList | boolean If true, return a list of all fields with source=custom_fields in the select instead of the standard _cstm.* This is required for any downstream construction of a SQL statement where we need to manipulate the select list, for example, listviews with custom relate fields where the value comes from join rather than from the custom table |
| $includeRelates | ||
| $where |
| Type | Description |
|---|---|
| array | select=>select columns, join=>prebuilt join statement |

getRelateJoin(
$field_def, $joinTableAlias
)
:
void| Name | Type | Description |
|---|---|---|
| $field_def | ||
| $joinTableAlias |

isDefaultValue(
$property, $value, $baseField
)
:
void| Name | Type | Description |
|---|---|---|
| $property | ||
| $value | ||
| $baseField |

populateAllXTPL(
$xtpl, $view
)
:
void| Name | Type | Description |
|---|---|---|
| $xtpl | ||
| $view |

populateXTPL(
$xtpl, $view
)
:
void| Name | Type | Description |
|---|---|---|
| $xtpl | ||
| $view |

removeVardefExtension(
$field
)
:
void| Name | Type | Description |
|---|---|---|
| $field |

repairCustomFields(
$execute
=
true
)
:
void| Name | Type | Description |
|---|---|---|
| $execute |

retrieve(
)
:
voidDEPRECATED loads fields into the bean This used to be called during the retrieve process now it is done through a join Restored from pre-r30895 to maintain support for custom code that may have called retrieve() directly
Inherited from: \DynamicField::retrieve()
saveExtendedAttributes(
$field, $column_fields
)
:
void| Name | Type | Description |
|---|---|---|
| $field | ||
| $column_fields |

saveToVardef(
string $module, array $result, boolean $saveCache
=
true
)
:
voidUpdates the cached vardefs with the custom field information stored in result
Inherited from: \DynamicField::saveToVardef()| Name | Type | Description |
|---|---|---|
| $module | string | |
| $result | array | |
| $saveCache | boolean | saveCache Boolean value indicating whether or not to call VardefManager::saveCache, defaults to true |

setLabel(
$language
=
'en_us', $key, $value
)
:
void| Name | Type | Description |
|---|---|---|
| $language | ||
| $key | ||
| $value |

setWhereClauses(
$where_clauses
)
:
void| Name | Type | Description |
|---|---|---|
| $where_clauses |

setup(
\SUGARBEAN $bean
=
null
)
:
voidThis will add the bean as a reference in this object as well as building the custom field cache if it has not been built LOADS THE BEAN IF THE BEAN IS NOT BEING PASSED ALONG IN SETUP IT SHOULD BE SET PRIOR TO SETUP
Inherited from: \DynamicField::setup()| Name | Type | Description |
|---|---|---|
| $bean | \SUGARBEAN |

writeVardefExtension(
$bean_name, $field, $def_override
)
:
void| Name | Type | Description |
|---|---|---|
| $bean_name | ||
| $field | ||
| $def_override |