include/SugarObjects/VardefManager.php
\VardefManager
Vardefs management
- Api
Properties
Methods

_clearCache(
string $module_dir
=
'', string $object_name
=
''
)
:
voidPRIVATE function used within clearVardefCache so we do not repeat logic
| Name | Type | Description |
|---|---|---|
| $module_dir | string | module_dir the module_dir to clear |
| $object_name | string | object_name the name of the object we are clearing this is for sugar_cache |

addTemplate(
$module, $object, $template, $object_name
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $module | ||
| $object | ||
| $template | ||
| $object_name |

applyGlobalAccountRequirements(
Array $vardef
)
:
ArrayapplyGlobalAccountRequirements
This method ensures that the account_name relationships are set to always be required if the configuration file specifies so. For more information on this require_accounts parameter, please see the administrators guide or go to the developers.sugarcrm.com website to find articles relating to the use of this field.
| Name | Type | Description |
|---|---|---|
| $vardef | Array | The vardefs of the module to apply the account_name field requirement to |
| Type | Description |
|---|---|
| Array | $vardef The vardefs of the module with the updated required setting based on the system configuration |

cleanVardefs(
Array $fieldDefs
)
:
ArrayRemove invalid field definitions
| Name | Type | Description |
|---|---|---|
| $fieldDefs | Array |
| Type | Description |
|---|---|
| Array |
- Static

clearVardef(
string $module_dir
=
'', string $object_name
=
''
)
:
voidclear out the vardef cache. If we receive a module name then just clear the vardef cache for that module otherwise clear out the cache for every module
| Name | Type | Description |
|---|---|---|
| $module_dir | string | module_dir the module_dir to clear, if not specified then clear clear vardef cache for all modules. |
| $object_name | string | object_name the name of the object we are clearing this is for sugar_cache |

createVardef(
$module, $object, $templates
=
array('default'), $object_name
=
false
)
:
voidthis method is called within a vardefs.php file which extends from a SugarObject.
It is meant to load the vardefs from the SugarObject.
| Name | Type | Description |
|---|---|---|
| $module | ||
| $object | ||
| $templates | ||
| $object_name |

getLinkFieldForRelationship(
$module, $object, $relName
)
:
void| Name | Type | Description |
|---|---|---|
| $module | ||
| $object | ||
| $relName |

getLinkFieldsForModule(
$module, $object
)
:
array | bool| Name | Type | Description |
|---|---|---|
| $module | ||
| $object |
| Type | Description |
|---|---|
| array | bool | returns a list of all fields in the module of type 'link'. |
- Static

getLinkedModulesFromFormula(
\SugarBean $focus, String $formula
)
:
array| Name | Type | Description |
|---|---|---|
| $focus | \SugarBean | |
| $formula | String |
| Type | Description |
|---|---|
| array | of related modules used in the formula |
- Static

loadVardef(
string $module, string $object, bool $refresh
=
false, $params
=
array()
)
:
voidload the vardefs for a given module and object
| Name | Type | Description |
|---|---|---|
| $module | string | the given module we want to load the vardefs for |
| $object | string | the given object we wish to load the vardefs for |
| $refresh | bool | whether or not we wish to refresh the cache file. |
| $params |

modHasCalcFieldsWithLink(
$module, $object, $linkName
)
:
bool| Name | Type | Description |
|---|---|---|
| $module | ||
| $object | ||
| $linkName |
| Type | Description |
|---|---|
| bool | return true if the module contains calculated fields with the specified link in the formula. |
- Static

refreshVardefs(
string $module, string $object, array $additional_search_paths
=
null, $cacheCustom
=
true, $params
=
array()
)
:
voidGiven a module, search all of the specified locations, and any others as specified in order to refresh the cache file
| Name | Type | Description |
|---|---|---|
| $module | string | the given module we want to load the vardefs for |
| $object | string | the given object we wish to load the vardefs for |
| $additional_search_paths | array | an array which allows a consumer to pass in additional vardef locations to search |
| $cacheCustom | ||
| $params |

saveCache(
string $module, string $object, $additonal_objects
=
array()
)
:
voidSave the dictionary object to the cache
| Name | Type | Description |
|---|---|---|
| $module | string | the name of the module |
| $object | string | the name of the object |
| $additonal_objects |

setCustomAllowedForModule(
String $module, Boolean $enable
)
:
nullEnables/Disables the loading of custom vardefs for a module.
| Name | Type | Description |
|---|---|---|
| $module | String | Module to be enabled/disabled |
| $enable | Boolean | true to enable, false to disable |
| Type | Description |
|---|---|
| null |

updateRelCFModules(
\$module $module, \$object $object
)
:
bool| Name | Type | Description |
|---|---|---|
| $module | \$module | String name of module. |
| $object | \$object | String name of module Bean. Updates a list of link fields which have relationships to modules with calculated fields that use this module. Needed to cause an update to those modules when this module is updated. |
| Type | Description |
|---|---|
| bool |
- Static