WorkflowActionProcessingHelper Class Reference

Public Member Functions

 __construct (ActionForWorkflowForm $action, RedBeanModel $triggeredModel, User $triggeredByUser, $canSaveTriggeredModel=true)
 processUpdateSelfAction ()
 processNonUpdateSelfAction ()

Protected Member Functions

 processUpdateRelatedAction ()
 processCreateAction ()
 resolveCreateModel (RedBeanModel $model, $relation, &$modelToForgetCache=null)
 processCreateRelatedAction ()
 processSubscribeToListAction ()
 resolveOneToManyPostCreateActionSaveModelCache (RedBeanModel $precedingModel, $precedingRelation, RedBeanModel $model)
 processUnsubscribeFromListAction ()

Static Protected Member Functions

static processActionAttributesForActionBeforeSave (ActionForWorkflowForm $action, RedBeanModel $model, User $triggeredByUser, RedBeanModel $triggeredModel, $create=false)
static processActionAttributesForActionAfterSave (ActionForWorkflowForm $action, RedBeanModel $model, User $triggeredByUser, RedBeanModel $triggeredModel)

Protected Attributes

 $action
 $triggeredModel
 $triggeredByUser
 $canSaveTriggeredModel

Detailed Description

Helper class for processing actions that trigger

Definition at line 40 of file WorkflowActionProcessingHelper.php.


Constructor & Destructor Documentation

__construct ( ActionForWorkflowForm action,
RedBeanModel triggeredModel,
User triggeredByUser,
canSaveTriggeredModel = true 
)
Parameters:
ActionForWorkflowForm $action
RedBeanModel $triggeredModel
User $triggeredByUser
bool $canSaveTriggeredModel - when processing a
See also:
ByTimeWorkflowInQueueJob the job will handle saving the model, so when creating new models as a result of an action, there is no need here to save the triggered model. This parameter then would be set to false in that scenario. Otherwise the triggered model will be saved when necessary since it is assumed it will not be saved after this execution.

Definition at line 71 of file WorkflowActionProcessingHelper.php.


Member Function Documentation

static processActionAttributesForActionBeforeSave ( ActionForWorkflowForm action,
RedBeanModel model,
User triggeredByUser,
RedBeanModel triggeredModel,
create = false 
) [static, protected]
Parameters:
ActionForWorkflowForm $action
RedBeanModel $model
User $triggeredByUser
RedBeanModel $triggeredModel
boolean $create

Definition at line 125 of file WorkflowActionProcessingHelper.php.

static processActionAttributesForActionAfterSave ( ActionForWorkflowForm action,
RedBeanModel model,
User triggeredByUser,
RedBeanModel triggeredModel 
) [static, protected]
Parameters:
ActionForWorkflowForm $action
RedBeanModel $model
User $triggeredByUser
RedBeanModel $triggeredModel

Definition at line 177 of file WorkflowActionProcessingHelper.php.

resolveCreateModel ( RedBeanModel model,
relation,
&$  modelToForgetCache = null 
) [protected]
Parameters:
RedBeanModel $model
$relation 
null $modelToForgetCache
Returns:
bool true if the $model passed in needs to be saved again. Otherwise false if not.
Exceptions:
NotSupportedException 
FailedToSaveModelException 

Definition at line 284 of file WorkflowActionProcessingHelper.php.

processCreateRelatedAction (  )  [protected]

Notice the use of $modelToForgetCache. This was needed to avoid a caching issue with the following example. If an opportunity fires, and a related account's opportunity is created. This new opportunity had a cached model for account that was null. So this is fixed by forgetting the new model after it is added to the account.

Exceptions:
FailedToSaveModelException 
NotSupportedException 

Definition at line 366 of file WorkflowActionProcessingHelper.php.

resolveOneToManyPostCreateActionSaveModelCache ( RedBeanModel precedingModel,
precedingRelation,
RedBeanModel model 
) [protected]
See also:
https://www.pivotaltracker.com/story/show/58372836 This method is called to resolve the issue of the cache having incorrect information and requiring a clearCache Now after saving, it will resolve the related model correctly.
Parameters:
RedBeanModel $precedingModel
string $precedingRelation
RedBeanModel $model

Definition at line 463 of file WorkflowActionProcessingHelper.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sun Sep 24 07:10:31 2017