Base helper class for managing adapting model relations and attributes into a workflow rule
Definition at line 40 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
__construct | ( | RedBeanModel $ | model, | |
WorkflowRules $ | rules, | |||
$ | workflowType, | |||
$ | moduleClassName = null | |||
) |
RedBeanModel | $model | |
WorkflowRules | $rules | |
string | $workflowType | |
string | $moduleClassName - optional for when there is a stateAdapter involved. In the case of LeadsModule it still uses the Contact model but is important to know that the originating module is Leads. If moduleClassName is not specified, then it will default to the model's moduleClassName |
Definition at line 144 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
static make | ( | $ | moduleClassName, | |
$ | modelClassName, | |||
$ | workflowType | |||
) | [static] |
string | $moduleClassName | |
string | $modelClassName | |
string | $workflowType |
NotSupportedException | if the workflowType is invalid or null |
Definition at line 84 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getModel | ( | ) |
Definition at line 115 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getModelClassName | ( | ) |
Definition at line 123 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getRules | ( | ) |
Definition at line 131 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getAttributeLabel | ( | $ | attribute | ) |
Enter description here ...
string | $attribute |
NotSupportedException | if the label is missing for the attribute |
Definition at line 163 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getRelationLabel | ( | $ | relation | ) |
Enter description here ...
string | $relation |
NotSupportedException | if the label is missing for the relation |
Definition at line 187 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
isUsedAsARelation | ( | $ | relationOrAttribute | ) |
Returns true/false if a string passed in is considered a relation from a workflow perspective. In this case a dropDown is not considered a relation because it is used in workflow as a regular attribute.
string | $relationOrAttribute |
Definition at line 204 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getRelationModuleClassName | ( | $ | relation | ) |
string | $relation |
NotSupportedException | if the relation string is malformed |
Definition at line 223 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getRelationModelClassName | ( | $ | relation | ) |
string | $relation |
NotSupportedException | if the relation is malformed |
Definition at line 255 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
static getInferredRelationModelClassName | ( | $ | relation | ) | [static] |
$relation |
Definition at line 283 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getAttributesForTriggers | ( | ) |
Override and implement in children classes
Definition at line 298 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getAttributesForTimeTrigger | ( | ) |
Override and implement in children classes
Reimplemented in ModelRelationsAndAttributesToByTimeWorkflowAdapter.
Definition at line 309 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getAllAttributesForActions | ( | ) |
Used by update actions since there is no difference between required and non-required.
Definition at line 318 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getRequiredAttributesForActions | ( | ) |
Definition at line 330 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getNonRequiredAttributesForActions | ( | ) |
Definition at line 342 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getAvailableOperatorsType | ( | $ | attribute | ) |
string | $attribute |
NotSupportedException | if the attribute is a derived attribute |
Definition at line 356 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getTriggerValueElementType | ( | $ | attribute | ) |
string | $attribute |
NotSupportedException | if the attribute is dynamically derived but not a __User attribute since this is the only type of dynamically derived attributes that are currently supported |
Definition at line 383 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getDisplayElementType | ( | $ | attribute | ) |
string | $attribute |
NotSupportedException | if the attribute is dynamically derived but not a __User attribute since this is the only type of dynamically derived attributes that are currently supported |
Definition at line 414 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getRealModelAttributeType | ( | $ | attribute | ) |
string | $attribute |
Definition at line 439 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getAllRelationsData | ( | ) |
Definition at line 448 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getSelectableRelationsDataResolvedForUserAccess | ( | User $ | user, | |
Array $ | relations | |||
) |
Resolves relations to only return relations that the user has access too. always returns user relations since this is ok for a user to see when creating or editing a workflow rule
User | $user | |
array | $relations |
NotSupportedException |
Definition at line 469 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getSelectableRelationsData | ( | RedBeanModel $ | precedingModel = null , |
|
$ | precedingRelation = null | |||
) |
Returns the array of selectable relations for creating a workflow rule. Does not include relations that are marked as cannotTrigger in the rules and also excludes relations that are marked as relations usedAsAttributes by the rules. Includes relations marked as derivedRelationsViaCastedUpModel.
Public for testing only
RedBeanModel | $precedingModel | |
null | $precedingRelation |
NotSupportedException |
Reimplemented in ModelRelationsAndAttributesToByTimeWorkflowAdapter, and ModelRelationsAndAttributesToOnSaveWorkflowAdapter.
Definition at line 500 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getAttributesIncludingDerivedAttributesData | ( | ) |
Definition at line 528 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
isRelationASingularRelation | ( | $ | relation | ) |
string | $relation |
NotSupportedException | if the relation string is malformed |
Definition at line 542 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getInferredRelationsData | ( | RedBeanModel $ | precedingModel = null , |
|
$ | precedingRelation = null , |
|||
$ | onlyIncludeThisModelClassName = null | |||
) |
RedBeanModel | $precedingModel | |
null|string | $precedingRelation | |
null|string | $onlyIncludeThisModelClassName |
NotSupportedException | if there the preceding model and relation are not either both defined or both null |
Definition at line 587 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getTriggerRulesByAttribute | ( | $ | attribute, | |
$ | ruleAttributeName | |||
) |
string | $attribute | |
string | $ruleAttributeName |
Definition at line 624 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
relationIsUsedAsAttribute | ( | $ | relation | ) |
string | $relation |
Definition at line 656 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
isDerivedRelationsViaCastedUpModelRelation | ( | $ | relation | ) |
string | $relation |
Definition at line 678 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
isInferredRelation | ( | $ | relation | ) |
string | $relation |
Definition at line 693 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
isDynamicallyDerivedAttribute | ( | $ | attribute | ) |
string | $attribute |
Definition at line 708 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
isAttributeReadOptimization | ( | $ | attribute | ) |
string | $attribute |
Definition at line 723 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
isDerivedAttribute | ( | $ | attribute | ) |
string | $attribute |
Definition at line 737 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
static resolveRealAttributeName | ( | $ | attribute | ) | [static] |
string | attribute |
Definition at line 752 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
static isAttributeInferred | ( | $ | attribute | ) | [static] |
Passing in an attribute string such as Account__activityItems__Inferred, detect if attribute is a inferred attribute or not.
$attribute |
Definition at line 779 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getSelectableRelationsDataForTriggers | ( | RedBeanModel $ | precedingModel = null , |
|
$ | precedingRelation = null | |||
) |
RedBeanModel | $precedingModel | |
null | $precedingRelation |
NotSupportedException |
Definition at line 797 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getSelectableRelationsDataForEmailMessageRecipientModelRelation | ( | ) |
Exclude User relations and Owned relations. Utilized by
Definition at line 837 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getSelectableContactRelationsDataForEmailMessageRecipientModelRelation | ( | ) |
Only includes relations that are to the 'Contact' model Utilized by
Definition at line 847 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getSelectableRelationsDataForActionTypeRelation | ( | ) |
Exclude User relations and Owned relations.
Definition at line 871 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getAttributesNotIncludingDerivedAttributesData | ( | ) | [protected] |
Definition at line 894 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
resolveAttributesForActionsOrTimeTriggerData | ( | $ | includeRequired = false , |
|
$ | includeNonRequired = false , |
|||
$ | includeReadOnly = false | |||
) | [protected] |
boolean | $includeRequired | |
boolean | $includeNonRequired | |
$includeReadOnly |
Definition at line 916 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
derivedRelationLinksToPrecedingRelation | ( | $ | relationModelClassName, | |
$ | opposingRelation, | |||
RedBeanModel $ | precedingModel = null , |
|||
$ | precedingRelation = null | |||
) | [protected] |
string | $relationModelClassName | |
string | $opposingRelation | |
null|RedBeanModel | $precedingModel | |
null|string | $precedingRelation |
Definition at line 951 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
inferredRelationLinksToPrecedingRelation | ( | $ | inferredModelClassName, | |
$ | relation, | |||
RedBeanModel $ | precedingModel = null , |
|||
$ | precedingRelation = null | |||
) | [protected] |
string | $inferredModelClassName | |
string | $relation | |
null|RedBeanModel | $precedingModel | |
null|string | $precedingRelation |
Definition at line 975 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
relationLinksToPrecedingRelation | ( | $ | relation, | |
RedBeanModel $ | precedingModel = null , |
|||
$ | precedingRelation = null | |||
) | [protected] |
string | $relation | |
null|RedBeanModel | $precedingModel | |
null|string | $precedingRelation |
Definition at line 1003 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getDerivedRelationsViaCastedUpModelData | ( | RedBeanModel $ | precedingModel = null , |
|
$ | precedingRelation = null , |
|||
$ | onlyIncludeThisModelClassName = null | |||
) | [protected] |
RedBeanModel | $precedingModel | |
null|string | $precedingRelation | |
null|string | $onlyIncludeThisModelClassName |
NotSupportedException | if there the preceding model and relation are not either both defined or both null |
Definition at line 1018 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getDerivedAttributesData | ( | ) | [protected] |
Definition at line 1056 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getDynamicallyDerivedAttributesData | ( | ) | [protected] |
Definition at line 1075 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
resolveDynamicallyDerivedAttributesForActionsOrTimeTriggerData | ( | $ | includeRequired = false , |
|
$ | includeNonRequired = false , |
|||
$ | includeReadOnly = false | |||
) | [protected] |
boolean | $includeRequired | |
boolean | $includeNonRequired | |
$includeReadOnly |
Definition at line 1097 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
getInferredRelationModelClassNamesForRelation | ( | $ | relation | ) | [protected] |
$relation |
Definition at line 1155 of file ModelRelationsAndAttributesToWorkflowAdapter.php.
resolveRelationToSelectableRelationData | ( | &$ | attributes, | |
$ | attribute | |||
) | [protected] |
array | $attributes | |
string | $attribute |
Definition at line 1165 of file ModelRelationsAndAttributesToWorkflowAdapter.php.