include/connectors/utils/ConnectorUtils.php
Constants
\ConnectorUtils
Connector utilities
- Api
Properties
Methods

cleanMetaDataFile(
String $module
)
:
voidWhen a module has all of the sources removed from it we do not properly remove it from the viewdefs. This function will handle that.
| Name | Type | Description |
|---|---|---|
| $module | String |
|

eapmEnabled(
string $id, $refresh
=
false
)
:
voidCheck if external accounts are enabled for this connector
| Name | Type | Description |
|---|---|---|
| $id | string | |
| $refresh |

getConnector(
string $id, bool $refresh
=
false
)
:
null | arrayGet connector data by ID
| Name | Type | Description |
|---|---|---|
| $id | string | |
| $refresh | bool |
| Type | Description |
|---|---|
| null | array | Connector data |

getConnectorButtonScript(
mixed $displayParams, mixed $smarty
)
:
StringgetConnectorButtonScript This method builds the HTML code for the hover link field
| Name | Type | Description |
|---|---|---|
| $displayParams | mixed | Array value of display parameters passed from the SugarField code |
| $smarty | mixed | The Smarty object from the calling smarty code |
| Type | Description |
|---|---|
| String | $code The HTML code for the hover link |

getConnectorStrings(
String $source_id, String $language
=
''
)
:
voidgetConnectorStrings This method returns the language Strings for a given connector instance
| Name | Type | Description |
|---|---|---|
| $source_id | String | String value of the connector id to retrive language strings for |
| $language | String | optional String value for the language to use (defaults to $GLOBALS['current_language']) |

getConnectors(
boolean $refresh
=
false
)
:
voidgetConnectors Returns an Array of the connectors that have been loaded into the system along with attributes pertaining to each connector.
| Name | Type | Description |
|---|---|---|
| $refresh | boolean | boolean flag indicating whether or not to force rewriting the file; defaults to false |
- Returns
- mixed $connectors Array of the connector entries found

getDisplayConfig(
$refresh
=
false
)
:
voidgetDisplayConfig
| Name | Type | Description |
|---|---|---|
| $refresh |

getMergeViewDefs(
boolean $refresh
=
false
)
:
mixedgetMergeViewDefs Returns an Array of the merge definitions used by the Connector module to merge values into the bean instance
| Name | Type | Description |
|---|---|---|
| $refresh | boolean | boolean value to manually refresh the mergeview definitions |
| Type | Description |
|---|---|
| mixed | $mergedefs Array of the merge definitions |
- Deprecated
- This method has been replaced by getViewDefs

getModuleConnectors(
String $module
)
:
arraygetModuleConnectors
| Name | Type | Description |
|---|---|---|
| $module | String | the module to get the connectors for |
| Type | Description |
|---|---|
| array |

getSearchDefs(
boolean $refresh
=
false
)
:
mixedgetSearchDefs Returns an Array of the search field defintions Connector module to search entries from the connector. If the searchdefs.php file in the custom directory is not found, it defaults to using the mapping.php file entries to create a default version of the file.
| Name | Type | Description |
|---|---|---|
| $refresh | boolean | boolean value to manually refresh the search definitions |
| Type | Description |
|---|---|
| mixed | $searchdefs Array of the search definitions |

getSources(
String $directory
=
'modules/Connectors/connectors/sources'
)
:
mixedgetSources Returns an Array of source entries found under the given directory
| Name | Type | Description |
|---|---|---|
| $directory | String | The directory to search |
| Type | Description |
|---|---|
| mixed | $sources An Array of source entries |

getViewDefs(
mixed $filter_sources
=
array()
)
:
mixedgetViewDefs Returns an Array of the merge definitions used by the Connector module to merge values into the bean instance
| Name | Type | Description |
|---|---|---|
| $filter_sources | mixed | Array optional Array value of sources to only use |
| Type | Description |
|---|---|
| mixed | $mergedefs Array of the merge definitions |

hasWizardSourceEnabledForModule(
String $module
=
''
)
:
booleanhasWizardSourceEnabledForModule This is a private method that returns a boolean value indicating whether or not at least one source is enabled for a given module. By enabled we mean that the source has the neccessary configuration properties set as determined by the isRequiredConfigFieldsForButtonSet method. In addition, a check is made to ensure that it is a source that has been enabled for the wizard.
| Name | Type | Description |
|---|---|---|
| $module | String | String value of module to check |
| Type | Description |
|---|---|
| boolean | $enabled boolean value indicating whether or not module has at least one source enabled |

installSource(
String $source
)
:
booleaninstallSource Install the name of the source (called from ModuleInstaller.php). Modifies the files in the custom directory to add the new source in.
| Name | Type | Description |
|---|---|---|
| $source | String | String value of the id of the connector to install |
| Type | Description |
|---|---|
| boolean | $result boolean value indicating whether or not connector was installed |

isModuleEnabled(
String $module
)
:
booleanisModuleEnabled Given a module name, checks to see if the module is enabled to be serviced by the connector module
| Name | Type | Description |
|---|---|---|
| $module | String | String name of the module |
| Type | Description |
|---|---|
| boolean | $enabled boolean value indicating whether or not the module is enabled to be serviced by the connector module |

isSourceEnabled(
String $source
)
:
booleanisSourceEnabled Given a source id, checks to see if the source is enabled for at least one module
| Name | Type | Description |
|---|---|---|
| $source | String | String name of the source |
| Type | Description |
|---|---|
| boolean | $enabled boolean value indicating whether or not the source is displayed in at least one module |

saveConnectors(
array $connectors, string $toFile
=
''
)
:
boolSave connectors array to file
| Name | Type | Description |
|---|---|---|
| $connectors | array | Source data to write |
| $toFile | string | filename to use |
| Type | Description |
|---|---|
| bool | success |

setConnectorStrings(
String $source_id, String $connector_strings, String $language
=
''
)
:
voidsetConnectorStrings This method outputs the language Strings for a given connector instance
| Name | Type | Description |
|---|---|---|
| $source_id | String | String value of the connector id to write language strings for (e.g., ext_soap_marketo) |
| $connector_strings | String | array value of the connector_strings |
| $language | String | optional String value for the language to use (defaults to $GLOBALS['current_language']) |

setDefaultHoverField(
Array $viewdefs, String $module, $source_id
)
:
booleansetDefaultHoverField Sets the hover field to the first element in the detailview screen
| Name | Type | Description |
|---|---|---|
| $viewdefs | Array | the metadata of the detailview |
| $module | String | the Module to which the hover field should be added to |
| $source_id |
| Type | Description |
|---|---|
| boolean | True if field was added; false otherwise |

setHoverField(
$viewdefs, $module, $hover_field, $source_id
)
:
void| Name | Type | Description |
|---|---|---|
| $viewdefs | ||
| $module | ||
| $hover_field | ||
| $source_id |

uninstallSource(
String $source
)
:
booleanuninstallSource
| Name | Type | Description |
|---|---|---|
| $source | String | String value of the id of the connector to un-install |
| Type | Description |
|---|---|
| boolean | $result boolean value indicating whether or not connector was un-installed |