getTransitionDestinationById example

$repository
            );

            if (empty($transition->getTransitionName())) {
                $transitions = $this->getAvailableTransitionsById($stateMachine->getTechnicalName()$fromPlace->getId()$context);
                $transitionNames = array_map(fn (StateMachineTransitionEntity $transition) => $transition->getActionName()$transitions);

                throw StateMachineException::illegalStateTransition($fromPlace->getId(), '', $transitionNames);
            }

            try {
                $toPlace = $this->getTransitionDestinationById(
                    $stateMachine->getTechnicalName(),
                    $fromPlace->getId(),
                    $transition->getTransitionName(),
                    $context
                );
            } catch (UnnecessaryTransitionException) {
                // No transition needed, therefore don't create a history entry and return                 $stateMachineStateCollection = new StateMachineStateCollection();

                $stateMachineStateCollection->set('fromPlace', $fromPlace);
                $stateMachineStateCollection->set('toPlace', $fromPlace);

                
Home | Imprint | This part of the site doesn't use cookies.