modules/DynamicFields/DynamicField.php

Show: inherited
Table of Contents

\DynamicField

Package:
Children
\StandardField

Properties

Propertypublic  $base_path= '""'
Default value""Details
Type
n/a
Propertypublic  $use_existing_labels= 'false'
Default valuefalseDetails
Type
n/a

Methods

methodpublicDynamicField(  $module = '' ) : void

Parameters
Name Type Description
$module
methodpublicaddField( \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

DEPRECIATED: Use addFieldObject instead.

Adds a Custom Field using parameters

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
Returns
Type Description
boolean
methodpublicaddFieldObject( \Field $field ) : boolean

Adds a custom field using a field object

Parameters
Name Type Description
$field \Field

Object $field

Returns
Type Description
boolean
methodpublicaddLabel( string $displayLabel ) : string

Adds a label to the module's mod_strings for the current language Note that the system label name

Parameters
Name Type Description
$displayLabel string

The label value to be displayed

Returns
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
methodpublicadd_existing_custom_field(  $data,  $execute = true ) : void

Parameters
Name Type Description
$data
$execute
methodpublicadd_existing_custom_fields(  $execute = true ) : void

Updates the db schema and adds any custom fields we have used if the custom table was dropped

Parameters
Name Type Description
$execute
methodpublicbuildCache( STRING $module = false, boolean $saveCache = true ) : \unknown

Builds the cache for custom fields based on the vardefs

Parameters
Name Type Description
$module STRING
$saveCache boolean

saveCache Boolean value indicating whether or not to pass saveCache value to saveToVardef, defaults to true

Returns
Type Description
\unknown
methodpubliccreateCustomTable(  $execute = true ) : void

Creates the custom table with an id of id_c

Parameters
Name Type Description
$execute
methodpublicdeleteCache( ) : void

methodpublicdeleteField(  $widget ) : void

Deletes 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

Parameters
Name Type Description
$widget
methodpublicfieldExists(  $name = '',  $type = '' ) : void

Parameters
Name Type Description
$name
$type
methodpublicfill_relationships( ) : void

Fills in all the custom fields of type relate relationships for an object

methodpublicgetAllFieldsView(  $view,  $type ) : void

Parameters
Name Type Description
$view
$type
methodpublicgetDBName( STRING $name, BOOLEAN $_C = true ) : STRING

Returns a Database Safe Name

Parameters
Name Type Description
$name STRING
$_C BOOLEAN

do we append _c to the name

Returns
Type Description
STRING
methodpublicgetFieldWidget(  $module,  $fieldName ) : void

Returns the widget for a custom field from the fields_meta_data table.

Parameters
Name Type Description
$module
$fieldName
methodpublicgetJOIN( \$expandedList $expandedList = false,  $includeRelates = false,  $where = false ) : array

returns either false or an array containing the select and join parameter for a query using custom fields

Parameters
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
Returns
Type Description
array select=>select columns, join=>prebuilt join statement
methodpublicgetModuleName( ) : void

methodpublicgetPackageName( ) : void

methodpublicgetRelateJoin(  $field_def,  $joinTableAlias ) : void

Parameters
Name Type Description
$field_def
$joinTableAlias
methodprotectedisDefaultValue(  $property,  $value,  $baseField ) : void

Parameters
Name Type Description
$property
$value
$baseField
methodpublicpopulateAllXTPL(  $xtpl,  $view ) : void

Parameters
Name Type Description
$xtpl
$view
methodpublicpopulateXTPL(  $xtpl,  $view ) : void

Parameters
Name Type Description
$xtpl
$view
methodprotectedremoveVardefExtension(  $field ) : void

Parameters
Name Type Description
$field
methodpublicrepairCustomFields(  $execute = true ) : void

Parameters
Name Type Description
$execute
methodpublicretrieve( ) : void

DEPRECATED 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

methodpublicsave( boolean $isUpdate ) : void

Process the save action for sugar bean custom fields

Parameters
Name Type Description
$isUpdate boolean
methodpublicsaveExtendedAttributes(  $field,  $column_fields ) : void

Parameters
Name Type Description
$field
$column_fields
methodpublicsaveToVardef( string $module, array $result, boolean $saveCache = true ) : void

Updates the cached vardefs with the custom field information stored in result

Parameters
Name Type Description
$module string
$result array
$saveCache boolean

saveCache Boolean value indicating whether or not to call VardefManager::saveCache, defaults to true

methodpublicsetLabel(  $language = 'en_us',  $key,  $value ) : void

Parameters
Name Type Description
$language
$key
$value
methodpublicsetWhereClauses(  $where_clauses ) : void

Parameters
Name Type Description
$where_clauses
methodpublicsetup( \SUGARBEAN $bean = null ) : void

This 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

Parameters
Name Type Description
$bean \SUGARBEAN
methodprotectedwriteVardefExtension(  $bean_name,  $field,  $def_override ) : void

Parameters
Name Type Description
$bean_name
$field
$def_override
Documentation was generated by DocBlox 0.18.1.