-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
added Workflow event methods documentation #7774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,6 +222,30 @@ could easily enable logging:: | |
$subscriber = new AuditTrailListener($logger); | ||
$dispatcher->addSubscriber($subscriber); | ||
|
||
Event methods | ||
~~~~~~~~~~~~~ | ||
Each workflow event is an instance of :class:`Symfony\\Component\\Workflow\\Event\\Event`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add a blank line before the paragraph? |
||
This means that each event has access to the following information: | ||
|
||
:method:`Symfony\\Component\\Workflow\\Event\\Event::getMarking` | ||
Returns the :class:`Symfony\\Component\\Workflow\\Marking` of the workflow | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should end all descriptions with a dot |
||
|
||
:method:`Symfony\\Component\\Worflow\\Event\\Event::getSubject` | ||
Returns the object that dispatches the event. | ||
|
||
:method:`Symfony\\Component\\Workflow\\Event\\Event::getTransition` | ||
Returns the :class:`Symfony\\Component\\Workflow\\Transition` that dispatches the event | ||
|
||
For Guard Events, there is an extended class :class:`Symfony\\Component\\Workflow\\Event\\GuardEvent`. This class has two more methods: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add a line break after the first sentence? |
||
|
||
:method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::isBlocked` | ||
Returns if transition is blocked | ||
|
||
:method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::setBlocked` | ||
Sets the blocked value | ||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one blank line is enough :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @xabbuh Should I change something you mentioned above, or will it be done while merging? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whatever you prefer. :) If you like to do it yourself before we merge it, that'll be fine. Otherwise, it will be no problem to do so while merging. |
||
Usage in Twig | ||
------------- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to our guidelines the headline should be "Event Methods"