Skip to content

Commit fee51ea

Browse files
committed
minor #7774 added Workflow event methods documentation (jangrubenbecher)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #7774). Discussion ---------- added Workflow event methods documentation to fix 7691, I added method descriptions to the usage site of the workflow component. Added the new getWorkflowName-method description as well Commits ------- 12b0f04 added Workflow event methods documentation
2 parents fa3120e + 12b0f04 commit fee51ea

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

workflow/usage.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,30 @@ could easily enable logging::
222222
$subscriber = new AuditTrailListener($logger);
223223
$dispatcher->addSubscriber($subscriber);
224224

225+
Event Methods
226+
~~~~~~~~~~~~~
227+
228+
Each workflow event is an instance of :class:`Symfony\\Component\\Workflow\\Event\\Event`.
229+
This means that each event has access to the following information:
230+
231+
:method:`Symfony\\Component\\Workflow\\Event\\Event::getMarking`
232+
Returns the :class:`Symfony\\Component\\Workflow\\Marking` of the workflow.
233+
234+
:method:`Symfony\\Component\\Worflow\\Event\\Event::getSubject`
235+
Returns the object that dispatches the event.
236+
237+
:method:`Symfony\\Component\\Workflow\\Event\\Event::getTransition`
238+
Returns the :class:`Symfony\\Component\\Workflow\\Transition` that dispatches the event.
239+
240+
For Guard Events, there is an extended class :class:`Symfony\\Component\\Workflow\\Event\\GuardEvent`.
241+
This class has two more methods:
242+
243+
:method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::isBlocked`
244+
Returns if transition is blocked.
245+
246+
:method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::setBlocked`
247+
Sets the blocked value.
248+
225249
Usage in Twig
226250
-------------
227251

0 commit comments

Comments
 (0)