afterLeaveWorkflow() public static method

Create name for a *after leave workflow* event.
public static afterLeaveWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string
$workflowId string the workflow id or any workflow id if not set
return string name of the event
Exemplo n.º 1
0
 public function events()
 {
     return [WorkflowEvent::beforeEnterStatus('Item06Workflow/new') => "beforeNew", WorkflowEvent::afterEnterStatus('Item06Workflow/new') => "afterNew", WorkflowEvent::afterEnterStatus('Item06Workflow/correction') => "postToCorrect", WorkflowEvent::beforeLeaveStatus('Item06Workflow/correction') => "postCorrected", WorkflowEvent::beforeEnterStatus('Item06Workflow/published') => "checkCanBePublished", WorkflowEvent::beforeChangeStatus('Item06Workflow/published', 'Item06Workflow/archive') => "canBeArchived", WorkflowEvent::beforeLeaveWorkflow('Item06Workflow') => 'beforeLeaveWorkflow', WorkflowEvent::afterLeaveWorkflow('Item06Workflow') => 'afterLeaveWorkflow'];
 }
 /**
  * Produces the following event sequence when a model leaves a workflow.
  *
  * - beforeLeaveStatus(*)
  * - beforeLeaveStatus(ID)
  * - beforeLeaveWorkflow(*)
  * - beforeLeaveWorkflow(WID)
  *
  * - afterLeaveStatus(*)
  * - afterLeaveStatus(ID)
  * - afterLeaveWorkflow(*)
  * - afterLeaveWorkflow(WID)
  *
  * @see \raoul2000\workflow\events\IEventSequence::createLeaveWorkflowSequence()
  */
 public function createLeaveWorkflowSequence($finalStatus, $sender)
 {
     return ['before' => [new WorkflowEvent(WorkflowEvent::beforeLeaveStatus(), ['start' => $finalStatus, 'sender' => $sender]), new WorkflowEvent(WorkflowEvent::beforeLeaveStatus($finalStatus->getId()), ['start' => $finalStatus, 'sender' => $sender]), new WorkflowEvent(WorkflowEvent::beforeLeaveWorkflow(), ['start' => $finalStatus, 'sender' => $sender]), new WorkflowEvent(WorkflowEvent::beforeLeaveWorkflow($finalStatus->getWorkflowId()), ['start' => $finalStatus, 'sender' => $sender])], 'after' => [new WorkflowEvent(WorkflowEvent::afterLeaveStatus(), ['start' => $finalStatus, 'sender' => $sender]), new WorkflowEvent(WorkflowEvent::afterLeaveStatus($finalStatus->getId()), ['start' => $finalStatus, 'sender' => $sender]), new WorkflowEvent(WorkflowEvent::afterLeaveWorkflow(), ['start' => $finalStatus, 'sender' => $sender]), new WorkflowEvent(WorkflowEvent::afterLeaveWorkflow($finalStatus->getWorkflowId()), ['start' => $finalStatus, 'sender' => $sender])]];
 }