Получает хранилище Workflow

@return WorkflowStoreInterface
@throws StoreException
@throws \OldTown\Workflow\Exception\FactoryException
541138
public function getWorkflowStore()
    {
        if (!$this->store) {
            $class = $this->getPersistence();

            if (!class_exists($class)) {
                $errMsg = sprintf(
                    'Отсутствует класс хранилища %s',
                    $class
                );
                throw new FactoryException($errMsg);
            }


            $store = new $class();
            if (!$store instanceof WorkflowStoreInterface) {
                throw new FactoryException('Ошибка при создание хранилища');
            }

            $storeArgs = $this->getPersistenceArgs();
            $store->init($storeArgs);

            $this->store = $store;
        }

        return $this->store;
    }
227909
protected function process()
    {

        // prepare the store view code
        $this->prepareStoreViewCode($this->getRow());

        // prepare the attributes
        $attr = $this->prepareAttributes();

        // load store/option ID
        $storeId = $attr[MemberNames::STORE_ID];
        $optionId = $attr[MemberNames::OPTION_ID];

        // if the store has already been mapped, return immediately
        if ($this->isMapped($optionId, $storeId)) {
            return;
        }

        // initialize and save the product bundle option value
        if ($bundleOption = $this->initializeBundleOptionValue($attr)) {
            $this->persistProductBundleOptionValue($bundleOption);
        }

        // add the store => option mapping
        $this->addOptionValueStoreMapping($optionId, $storeId);
    }
331634
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var Dispatcher $dispatcher */
        $dispatcher = $serviceLocator->get(Dispatcher::class);

        $options = [
            'dispatcher' => $dispatcher
        ];

        return new WorkflowDispatchListener($options);
    }
520427
public function handleException(ServerRequestInterface $request): ResponseInterface
    {
        /** @var MiddlewareInterface $middleware */
        $middleware = $this->getExceptionHandlers()->getNextMiddleware();
        if (!$middleware) {
            throw new WorkflowException(
                'No suitable middleware was found to handle the uncaught exception.',
                null,
                $request->getAttribute('exception')
            );
        }

        $this->getServicesFactory()->injectDependencies($middleware);

        $response = $middleware->process($request, $this);

        return $response;
    }
258531
public function store()
    {
        $request = $this->makeRequest('store');
        $model = $this->service->create($request);

        if(is_a($model, \Exception::class)) {

            return $this->getErrorResource($model);

        } else {

            return $this->maybeMakeResource('single', $model, 201);
        }

    }
1172677
public function build()
    {
        return new StoreCounter($this->location, new CounterUpdate($this->delta), $this->context, $this->options);
    }
271511
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $resource = new WorkflowRelease();

        $resource->setWorkflowFinder($serviceLocator->getServiceLocator()->get(\Prooph\Link\ProcessManager\Projection\Workflow\WorkflowFinder::class));

        return $resource;
    }
717523
public function Form()
    {
        $svc            = singleton(WorkflowService::class);
        $active         = $svc->getWorkflowFor($this->getContextObject());

        if (!$active) {
            return;
            //throw new Exception('Workflow not found, or not specified for Context Object');
        }

        $wfFields     = $active->getFrontEndWorkflowFields();
        $wfActions    = $active->getFrontEndWorkflowActions();
        $wfValidator  = $active->getFrontEndRequiredFields();

        //Get DataObject for Form (falls back to ContextObject if not defined in WorkflowAction)
        $wfDataObject = $active->getFrontEndDataObject();

        // set any requirements spcific to this contextobject
        $active->setFrontendFormRequirements();

        // hooks for decorators
        $this->extend('updateFrontEndWorkflowFields', $wfFields);
        $this->extend('updateFrontEndWorkflowActions', $wfActions);
        $this->extend('updateFrontEndRequiredFields', $wfValidator);
        $this->extend('updateFrontendFormRequirements');

        $form = new FrontendWorkflowForm($this, 'Form/' . $this->getContextID(), $wfFields, $wfActions, $wfValidator);

        $form->addExtraClass("fwf");

        if ($wfDataObject) {
            $form->loadDataFrom($wfDataObject);
        }

        return $form;
    }
1158142
protected function proxy() {
        if (!$this->context) {
            $this->context = new WorkflowContext(
                $this->version,
                $this->solution['workspaceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
411128
public function getWorkflowFields()
    {
        $action    = $this->CurrentAction();
        $options   = $this->validTransitions();
        $wfOptions = $options->map('ID', 'Title', ' ');
        $fields    = new FieldList();

        $fields->push(new HeaderField('WorkflowHeader', $action->Title));

        $fields->push(HiddenField::create('TransitionID', ''));
        // Let the Active Action update the fields that the user can interact with so that data can be
        // stored for the workflow.
        $action->updateWorkflowFields($fields);
        $action->invokeWithExtensions('updateWorkflowFields', $fields);
        return $fields;
    }
1167284
protected function __apiStore()
    {
        $data = $this->getInputData();

        $record = HCMenu::create(array_get($data, 'record'));

        $record->menu_groups()->sync(array_get($data, 'menu_groups'));

        $record->forgetMenuCache();

        return $this->apiShow($record->id);
    }
252201
final public function store() {
		
		// hook for tasks to be executed before store
		$this->beforeStore();
		
		// create if object’s keys are populated
		if ($this->areKeysPopulated() and static::exists($this->getId())) {
			$ret = $this->update();
		} else {
			$ret = $this->create();
		}

		// hook for tasks to be executed after store
		$this->afterStore();
		
		return $ret;

	}
934505
public function getFrontEndDataObject()
    {
        $obj = null;
        $ba = $this->BaseAction();

        if ($ba->hasMethod('getFrontEndDataObject')) {
            $obj = $ba->getFrontEndDataObject();
        } else {
            $obj = $this->Workflow()->getTarget();
        }

        return $obj;
    }
675537
public function getWorkflow($workflow)
    {
        if (!isset($this->workflows[$workflow])) {
            $this->loadWorkflow($workflow);
        }

        return $this->workflows[$workflow];
    }
1254932
public function processPayment()
    {
        $bankwireMethod = $this
            ->methodFactory
            ->create();

        /**
         * At this point, order must be created given a cart, and placed in PaymentBridge.
         *
         * So, $this->paymentBridge->getOrder() must return an object
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderLoad(
                $this->paymentBridge,
                $bankwireMethod
            );

        /**
         * Order Not found Exception must be thrown just here.
         */
        if (!$this->paymentBridge->getOrder()) {
            throw new PaymentOrderNotFoundException();
        }

        /**
         * Order exists right here.
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderCreated(
                $this->paymentBridge,
                $bankwireMethod
            );

        /**
         * Payment paid done.
         *
         * Paid process has ended ( No matters result )
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderDone(
                $this->paymentBridge,
                $bankwireMethod
            );

        return $this;
    }
120953
protected function getStore()
    {
        $store = $this->getSessionContainer();

        if ( empty( $store['stack'] ) )
        {
            $store['stack'] = array();
        }

        if ( empty( $store['steps'] ) )
        {
            $store['steps'] = array();
        }

        return $store;
    }
386603
public function createAction()
    {
        // Load form
        $entityClass = $this->getModuleNamespace() . '\Entity\\' . $this->getEntityName();
        $entity      = new $entityClass();
        $form        = $this->getForm('Create' . $this->getEntityName());
        $form->bind($entity);

        // Implement Post/Redirect/Get pattern
        $prg = $this->prg();
        if ($prg instanceof Response) {
            return $prg;
        } else if (false !== $prg) {

            // Set form data
            $form->setData($prg);

            // Create account
            $result = $this->getService()->create();
            if ($result) {
                return $this->redirect()->toRoute($this->indexRoute);
            }
        }

        // Set up view model
        $viewModel = new ViewModel(array(
            'entityName' => $this->getEntityName(),
            'form'       => $form,
        ));
        $viewModel->setTemplate('infinity-base/crud/create');

        return $viewModel;
    }