W3cubDocs

/Symfony 4.1

WorkflowExtension

class WorkflowExtension extends AbstractExtension

WorkflowExtension.

Methods

__construct(Registry $workflowRegistry)
getFunctions()
bool canTransition(object $subject, string $transitionName, string $name = null)

Returns true if the transition is enabled.

Transition[] getEnabledTransitions(object $subject, string $name = null)

Returns all enabled transitions.

bool hasMarkedPlace(object $subject, string $placeName, string $name = null)

Returns true if the place is marked.

string[]|int[] getMarkedPlaces(object $subject, bool $placesNameOnly = true, string $name = null)

Returns marked places.

string|null getMetadata($subject, string $key, $metadataSubject = null, string $name = null)

Returns the metadata for a specific subject.

getName()

Details

__construct(Registry $workflowRegistry)

Parameters

Registry $workflowRegistry

getFunctions()

bool canTransition(object $subject, string $transitionName, string $name = null)

Returns true if the transition is enabled.

Parameters

object $subject A subject
string $transitionName A transition
string $name A workflow name

Return Value

bool true if the transition is enabled

Transition[] getEnabledTransitions(object $subject, string $name = null)

Returns all enabled transitions.

Parameters

object $subject A subject
string $name A workflow name

Return Value

Transition[] All enabled transitions

bool hasMarkedPlace(object $subject, string $placeName, string $name = null)

Returns true if the place is marked.

Parameters

object $subject A subject
string $placeName A place name
string $name A workflow name

Return Value

bool true if the transition is enabled

string[]|int[] getMarkedPlaces(object $subject, bool $placesNameOnly = true, string $name = null)

Returns marked places.

Parameters

object $subject A subject
bool $placesNameOnly If true, returns only places name. If false returns the raw representation
string $name A workflow name

Return Value

string[]|int[]

string|null getMetadata($subject, string $key, $metadataSubject = null, string $name = null)

Returns the metadata for a specific subject.

Parameters

$subject
string $key
$metadataSubject
string $name

Return Value

string|null

getName()

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bridge/Twig/Extension/WorkflowExtension.html