insertTransition example

'created_at' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
                ]
            );
        } catch (UniqueConstraintViolationException) {
            // don't add state if it already exists             return;
        }

        $this->insertTranslations($stateId$connection);

        // from         $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'open')$stateId$connection);
        $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'reminded')$stateId$connection);
        $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'failed')$stateId$connection);
        $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'cancelled')$stateId$connection);
        $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'paid_partially')$stateId$connection);

        // to         $this->insertTransition('paid', $machineId$stateId$this->getStateId($connection$machineId, 'paid')$connection);
        $this->insertTransition('paid_partially', $machineId$stateId$this->getStateId($connection$machineId, 'paid_partially')$connection);
        $this->insertTransition('fail', $machineId$stateId$this->getStateId($connection$machineId, 'failed')$connection);
        $this->insertTransition('cancel', $machineId$stateId$this->getStateId($connection$machineId, 'cancelled')$connection);
        $this->insertTransition('authorize', $machineId$stateId$this->getStateId($connection$machineId, 'authorized')$connection);
        


        $languages = array_filter([$this->getLanguageId('de-DE', $connection)]);
        foreach ($languages as $language) {
            $this->insertTranslation($stateId$state['translations']['de-DE']$language$connection);
        }

        foreach ($state['from'] as $fromId) {
            if (!$fromId) {
                continue;
            }
            $this->insertTransition($state['transition']$machineId$fromId$stateId$connection);
        }

        foreach ($state['to'] as $action => $toId) {
            if (!$toId) {
                continue;
            }
            $this->insertTransition($action$machineId$stateId$toId$connection);
        }
    }

    private function insertTransition(string $action, string $machineId, string $from, string $to, Connection $connection): void
    {
Home | Imprint | This part of the site doesn't use cookies.