From 2e5a64da828f1bafdb1b4170680a12c7c54d18dd Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 13 Apr 2022 13:36:58 +0200 Subject: [PATCH] add back information on accessing the context in guard events This information was present in older versions of the documentation, but got lost when the `versionadded` directive was removed in the `6.0` branch. --- workflow.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/workflow.rst b/workflow.rst index 49486c00074..730ddc0926b 100644 --- a/workflow.rst +++ b/workflow.rst @@ -382,14 +382,14 @@ order: $workflow->apply($subject, $transitionName, [Workflow::DISABLE_ANNOUNCE_EVENT => true]); - The context is accessible in all events:: +The context is accessible in all events except for the ``workflow.guard`` events:: - // $context must be an array - $context = ['context_key' => 'context_value']; - $workflow->apply($subject, $transitionName, $context); + // $context must be an array + $context = ['context_key' => 'context_value']; + $workflow->apply($subject, $transitionName, $context); - // in an event listener (workflow.guard events) - $context = $event->getContext(); // returns ['context'] + // in an event listener (workflow.guard events) + $context = $event->getContext(); // returns ['context'] .. note::