getAvailableTransitionsById example


    public function getAvailableTransitions(
        string $entityName,
        string $entityId,
        string $stateFieldName,
        Context $context
    ): array {
        $stateMachineName = $this->getStateField($stateFieldName$entityName)->getStateMachineName();
        $repository = $this->definitionRegistry->getRepository($entityName);
        $fromPlace = $this->getFromPlace($entityName$entityId$stateFieldName$context$repository);

        return $this->getAvailableTransitionsById($stateMachineName$fromPlace->getId()$context);
    }

    /** * @throws StateMachineException * @throws IllegalTransitionException * @throws InconsistentCriteriaIdsException * @throws DefinitionNotFoundException */
    public function transition(Transition $transition, Context $context): StateMachineStateCollection
    {
        return $context->scope(Context::SYSTEM_SCOPE, function DContext $context) use ($transition): StateMachineStateCollection {
            
Home | Imprint | This part of the site doesn't use cookies.