com\setasign\Konquadrat\Workflow

Workflow

File: /Konquadrat/src/Workflow/Workflow.php

Class hierarchy

Summary

Constants

DEFAULT_BUTTON_NEXT

public const Workflow::DEFAULT_BUTTON_NEXT = 'nextStep'

DEFAULT_BUTTON_PREVIOUS

public const Workflow::DEFAULT_BUTTON_PREVIOUS = 'previousStep'

RENDERER_SMARTY

public const Workflow::RENDERER_SMARTY = 'smarty'

RENDERER_TWIG

public const Workflow::RENDERER_TWIG = 'twig'

STATE_NONE

private const Workflow::STATE_NONE = 'none'

STATE_OBJECTS

private const Workflow::STATE_OBJECTS = 'objects'

STATE_ON_SUBMIT

private const Workflow::STATE_ON_SUBMIT = 'onSubmit'

STATE_VIEW

private const Workflow::STATE_VIEW = 'view'

WORKFLOW_HELPER

public const Workflow::WORKFLOW_HELPER = 2

WORKFLOW_OBJECT

public const Workflow::WORKFLOW_OBJECT = 1

Properties

$caughtExceptions

protected array Workflow::$caughtExceptions = array()

$config

protected Workflow::$config

$currentContext

protected Workflow::$currentContext = array()

$data

protected Workflow::$data

$editMode

protected Workflow::$editMode = false

$extraParams

protected array Workflow::$extraParams = array()

ExtraParams that can be set by the workflow block.

Will not be serialized!

$formAction

protected Workflow::$formAction

$hash

protected Workflow::$hash

$initiatedSteps

protected array Workflow::$initiatedSteps = array()

$konquadrat

protected Workflow::$konquadrat

$logger

protected Workflow::$logger

$origin

protected Workflow::$origin

The origin from where the workflow was loaded.

$output

protected Workflow::$output = array()

HTML output

$path

protected string[] Workflow::$path = array()

The path of the individual steps

$renderer

protected Workflow::$renderer

$state

protected Workflow::$state = 'none'

$stepChanges

protected null|array{nextStep: string}|array{previousStep: string} Workflow::$stepChanges

$textItems

protected ?array Workflow::$textItems

Memorized text items


Methods

__construct()

public Workflow::__construct (
void
)

Workflow constructor.

__debugInfo()

public Workflow::__debugInfo (
void
): void

__sleep()

public Workflow::__sleep (
void
): array

addMethodResult()

public Workflow::addMethodResult (
string $name,
mixed $result
): void
Parameters
$name : string
 
$result : mixed
 
Exceptions

Throws \com\setasign\Konquadrat\Exception

checkHash()

public Workflow::checkHash (
void
): void
Exceptions

Throws HashMismatchException

fail()

public Workflow::fail (
void
): bool

Returns false. When used in onSubmit it will fail the submit process.

forceReload()

public Workflow::forceReload (
void
): \never
Exceptions

Throws ForceResponseException

getById()

public Workflow::getById (
string $id,
int $onlyType = 3
): ?mixed

Returns an object or helper by its id.

Parameters
$id : string
 
$onlyType : int

BitMask, valid flags are WORKFLOW_OBJECT and WORKFLOW_HELPER

getCatchedExceptions()

WARNING: This method is marked as deprecated!

Use getCaughtExceptions() instead

public Workflow::getCatchedExceptions (
void
): array

getCaughtExceptions()

public Workflow::getCaughtExceptions (
void
): array

getCurrentContext()

public Workflow::getCurrentContext (
void
): array

getCurrentStep()

public Workflow::getCurrentStep (
void
): ?string

getCurrentStepConfig()

getEditModeData()

public Workflow::getEditModeData (
void
): array

getError()

public Workflow::getError (
string $name,
string|array|null $context = null
): ?Validator\ValidationError

Returns the error code.

Parameters
$name : string
 
$context : string|array|null
 
Return Values

Returns null if no error

getExtraParams()

public Workflow::getExtraParams (
void
): array

getId()

public Workflow::getId (
void
): string

Get the workflow id

getIdByObject()

public Workflow::getIdByObject (
object $object
): ?string
Parameters
$object : object
 

getKonquadrat()

getLanguage()

public Workflow::getLanguage (
void
): string

getLogger()

public Workflow::getLogger (
void
): ?\Psr\Log\LoggerInterface

getObjects()

public Workflow::getObjects (
void
): array

Get all object and helper instances.

getRenderer()

getRequest()

public Workflow::getRequest (
void
): \com\setasign\SetaFramework\Request\ServerRequest

getSession()

public Workflow::getSession (
void
): \com\setasign\SetaFramework\Session\SessionInterface

getStepChanges()

public Workflow::getStepChanges (
void
): ?array

Returns the current step changes. Will be always null in view.

getSteps()

public Workflow::getSteps (
void
): array

Returns the available step names.

getTextItems()

public Workflow::getTextItems (
void
): array

getUsedNextStepButton()

public Workflow::getUsedNextStepButton (
void
): ?string

getUsedPreviousStepButton()

public Workflow::getUsedPreviousStepButton (
void
): ?string

goBackToStep()

protected Workflow::goBackToStep (
?string $target
): string
Parameters
$target : ?string

If $target is null we go one step backwards.

hasCatchedExceptions()

WARNING: This method is marked as deprecated!

Use hasCaughtExceptions() instead

public Workflow::hasCatchedExceptions (
void
): bool

hasCaughtExceptions()

public Workflow::hasCaughtExceptions (
void
): bool

hasError()

public Workflow::hasError (
null|string|string[] $context = null
): bool

Checks whether there is any error in the workflow/context.

Parameters
$context : null|string|string[]
 

hydrate()

initStep()

protected Workflow::initStep (
string $stepId
): void
Parameters
$stepId : string
 
Exceptions

Throws \com\setasign\Konquadrat\Exception

isEditMode()

public Workflow::isEditMode (
void
): bool

isError()

public Workflow::isError (
string $name,
null|string|string[] $context = null
): bool

Checks whether a specific field has an error.

Parameters
$name : string
 
$context : null|string|string[]
 

output()

public Workflow::output (
string $html
): void

Add content to the HTML output.

Parameters
$html : string
 

process()

public Workflow::process (
void
): string
Exceptions

Throws ForceResponseException

Throws ObjectsInitException

Throws \Exception

processData()

protected Workflow::processData (
void
): void
Exceptions

Throws ForceResponseException

processGoToNextStep()

protected Workflow::processGoToNextStep (
string $usedButton
): ?string
Parameters
$usedButton : string
 
Exceptions

Throws \com\setasign\Konquadrat\Exception

Throws ForceResponseException

processGoToPreviousStep()

protected Workflow::processGoToPreviousStep (
string $usedButton
): string
Parameters
$usedButton : string
 

processStepChangesAndCurrentStep()

processView()

protected Workflow::processView (
void
): string

registerById()

public Workflow::registerById (
string $id,
?object $object
): void

Registers an object or helper by its id.

Parameters
$id : string
 
$object : ?object
 

registerError()

public Workflow::registerError (
string $name,
null|string|string[] $context,
null|Validator\ReturnValues|bool|mixed $result,
bool $overwrite = false
): void

Adds the result of a check.

If the check is already defined an exception will be thrown.

Parameters
$name : string

Name of the check or the field

$context : null|string|string[]
 
$result : null|Validator\ReturnValues|bool|mixed

The result of the check. It will only be an error if $result is false or a ValidationError instance.

$overwrite : bool

If true - already existing checks will be overwritten instead of throwing an exception.

registerField()

public Workflow::registerField (
string $fieldName,
null|string|string[] $context = null,
?array $allowedValues = null
): string
Parameters
$fieldName : string
 
$context : null|string|string[]
 
$allowedValues : ?array
 
Return Values

Returns the field id

registerStepValidator()

public Workflow::registerStepValidator (
Validator\ValidatorInterface $validator,
null|string|string[] $context = null
): void
Parameters
$validator : Validator\ValidatorInterface
 
$context : null|string|string[]
 

reset()

public Workflow::reset (
void
): void

Resets the workflow.

resolveContext()

protected Workflow::resolveContext (
null|string|array $context = null
): array
Parameters
$context : null|string|array
 

setCurrentContext()

public Workflow::setCurrentContext (
array $context
): void
Parameters
$context : array
 

setData()

public Workflow::setData (
$data
): void
Parameters
$data
 

setEditMode()

public Workflow::setEditMode (
bool $editMode = true
): void
Parameters
$editMode : bool
 

setEditModeData()

public Workflow::setEditModeData (
array $data
): void
Parameters
$data : array
 

setExtraParams()

public Workflow::setExtraParams (
array $extraParams
): void
Parameters
$extraParams : array
 

setFormAction()

public Workflow::setFormAction (
string $formAction
): void
Parameters
$formAction : string
 

unregisterById()

public Workflow::unregisterById (
string $id
): void
Parameters
$id : string
 

unregisterStepValidator()

public Workflow::unregisterStepValidator (
null|string|string[] $context = null
): void
Parameters
$context : null|string|string[]