include/SugarObjects/VardefManager.php
\VardefManager
Vardefs management
- Api
Properties
Methods
_clearCache(
string $module_dir
=
'', string $object_name
=
''
)
:
void
PRIVATE 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
)
:
Array
applyGlobalAccountRequirements
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
)
:
Array
Remove invalid field definitions
Name | Type | Description |
---|---|---|
$fieldDefs | Array |
Type | Description |
---|---|
Array |
- Static
clearVardef(
string $module_dir
=
'', string $object_name
=
''
)
:
void
clear 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
)
:
void
this 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()
)
:
void
load 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()
)
:
void
Given 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()
)
:
void
Save 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
)
:
null
Enables/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