Programming Language PHP

Namespace Oro\Bundle\WorkflowBundle\Helper

Class TransitionEventTriggerHelper

Method/Function buildContextValues

Total Examples 1

1 code examples of PHP Oro\Bundle\WorkflowBundle\Helper\TransitionEventTriggerHelper::buildContextValues extracted from open source projects

Was this example useful?
0
                                                    private function createContext(TransitionEventTrigger $trigger): array
    {
        $definition = $trigger->getWorkflowDefinition();
        $mainEntityClass = $definition->getRelatedEntity();

        $mainEntity = $this->createClassStub($mainEntityClass);
        $eventEntityClass = $trigger->getEntityClass();

        if ($eventEntityClass === $mainEntityClass) {
            $eventEntity = $mainEntity;
        } else {
            $eventEntity = $this->createClassStub($eventEntityClass);
        }

        return TransitionEventTriggerHelper::buildContextValues(
            $trigger->getWorkflowDefinition(),
            $eventEntity,
            $mainEntity,
            $this->createClassStub(WorkflowItem::class)
        );
    }
                                            
TransitionEventTriggerHelper's Other Methods