Slide 79
Slide 79 text
@michellesanver #phpday
/**
* @return array Hashmap of Symfony events this handler cares about
*/
public static function getSubscribedEvents()
{
return [
// Guard events (Validate whether the transition is allowed at all)
'workflow.order.guard' => 'guardGeneralOrderWorkflow',
sprintf('workflow.order.guard.%s', Order::TRANSITION_CHANGE_REGION) => 'guardChangeRegion',
sprintf('workflow.order.guard.%s', Order::TRANSITION_CONFIRM_ORDER) => 'guardConfirmOrder',
sprintf('workflow.order.guard.%s', Order::TRANSITION_ASSIGN_PICKER) => 'guardAssignPicker',
sprintf('workflow.order.guard.%s', Order::TRANSITION_ASSIGN_CUSTOMER) => 'guardAssignCustomer',
// Enter events (The object is about to enter a new place)
sprintf('workflow.order.enter.%s', Order::STATE_CONFIRMED) => 'enterConfirmed',
sprintf('workflow.order.enter.%s', Order::STATE_DELIVERED) => 'enterDelivered',
// Entered events (The object entered a new place)
sprintf('workflow.order.entered.%s', Order::STATE_PICKED_UP) => 'enteredPickedUp',
// The object has completed this transition.
'workflow.order.completed' => 'onCompleted',
];
}