include/Expressions/DependencyManager.php
\DependencyManager
Dependent field manager
- Api
Properties
Methods

getCalculatedFieldDependencies(
$fields, Boolean $includeReadOnly
=
true, Boolean $orderMatters
=
false
)
:
\array<Dependency>Returns a new Dependency that will power the provided calculated field.
| Name | Type | Description |
|---|---|---|
| $fields | ||
| $includeReadOnly | Boolean | include the read-only actions to ensure calculated fields are not modified by the user in edit views. These are not required on detail/list views |
| $orderMatters | Boolean | Order matters on views with multiple calculated fields that rely on each-other. If all the values are currently up to date, order doesn't matter. |
| Type | Description |
|---|---|
| \array<Dependency> |

getDependenciesForFields(
$fields, $view
=
""
)
:
void| Name | Type | Description |
|---|---|---|
| $fields | ||
| $view |

getDependenciesForView(
array $viewdef, string $view
=
"", string $module
=
""
)
:
\array<Dependency>Returns a full set of the SugarLogic Dependencies to drive the business logic for a given view.
| Name | Type | Description |
|---|---|---|
| $viewdef | array | view metadata (editviewdefs, detailviewdefs, ect) |
| $view | string | name of view and its form element ("EditView", "DetailView", "QuickCreate", ect) |
| $module | string | Primary module for this view |
| Type | Description |
|---|---|
| \array<Dependency> |
- Static

getDependentFieldDependencies(
array $fields
)
:
\array<Dependency>Used to get a set of Dependencies to drive the dependent fields for this module.
| Name | Type | Description |
|---|---|---|
| $fields | array | fielddef array to create the dependencies from |
| Type | Description |
|---|---|
| \array<Dependency> |
- Static

getDependentFieldTriggerFields(
array $fields, $fieldDefs
=
array()
)
:
\array<Dependency>Used to get a set of Dependencies to drive the dependent fields for this module.
| Name | Type | Description |
|---|---|---|
| $fields | array | fielddef array to create the dependencies from |
| $fieldDefs |
| Type | Description |
|---|---|
| \array<Dependency> |
- Static

getDropDownDependencies(
array $fields
)
:
\array<Dependency>Used to get a set of Dependencies to drive the Dependent Dropdown fields for this module.
| Name | Type | Description |
|---|---|---|
| $fields | array | fielddef array to create the dependencies from |
| Type | Description |
|---|---|
| \array<Dependency> |
- Static

getJSUserVariables(
\$user $user
)
:
string| Name | Type | Description |
|---|---|---|
| $user | \$user | User, user to return SugarLogic variables for |
| Type | Description |
|---|---|
| string |
- Static

getLinkFields(
\$fields $fields, \$view $view
)
:
string| Name | Type | Description |
|---|---|---|
| $fields | \$fields | array, field_defs for this view |
| $view | \$view | string, name of view (form name) |
| Type | Description |
|---|---|
| string |
- Static
- returns the javascript for the link variables of this view.

getModuleDependenciesForAction(
string $module, string $action, string $form
=
"EditView"
)
:
\array<Dependency>Returns the set of the custom SugarLogic Dependencies defined in the dependency metadata for a module that are valid for the given action.
| Name | Type | Description |
|---|---|---|
| $module | string | Primary module for this action |
| $action | string | name of the action to get dependencies for ("edit", "view", "save", ect) |
| $form | string | name of the form element used on html forms |
| Type | Description |
|---|---|
| \array<Dependency> |
- Static

getPanelDependency(
$panel_id, $dep_expression
)
:
\array<Dependency>Used to get a set of Dependencies to drive the dependent panels for this module.
| Name | Type | Description |
|---|---|---|
| $panel_id | ||
| $dep_expression |
| Type | Description |
|---|---|
| \array<Dependency> |
- Static

orderCalculatedFields(
$deps, $formulaFields
)
:
void| Name | Type | Description |
|---|---|---|
| $deps | ||
| $formulaFields |

updateWeights(
$weights, $updated, $formulaFields, $field
)
:
void| Name | Type | Description |
|---|---|---|
| $weights | ||
| $updated | ||
| $formulaFields | ||
| $field |