Skip to content

Commit 12b0f04

Browse files
jangrubenbecherxabbuh
authored andcommitted
added Workflow event methods documentation
1 parent fa3120e commit 12b0f04

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)