From 8eb961eb02634aaa6ff362188ba976c857f88e92 Mon Sep 17 00:00:00 2001 From: Jan Grubenbecher Date: Sat, 8 Apr 2017 14:48:02 +0200 Subject: [PATCH 1/3] added Workflow event methods documentation --- workflow/usage.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/workflow/usage.rst b/workflow/usage.rst index d0e778af401..f949cf19bae 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -222,6 +222,33 @@ 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`. +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 + +: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 + +:method:`Symfony\\Component\\Workflow\\Event\\Event::getWorkflowName` + Returns the name of the workflow that triggers the event + +For Guard Events, there is an extended class :class:`Symfony\\Component\\Workflow\\Event\\GuardEvent`. This class has two more methods: + +:method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::isBlocked` + Returns if transition is blocked + +:method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::setBlocked` + Sets the blocked value + + + Usage in Twig ------------- From 8d1379fc648703ef56228f55da0741ef49886607 Mon Sep 17 00:00:00 2001 From: Jan Grubenbecher Date: Sat, 8 Apr 2017 15:07:01 +0200 Subject: [PATCH 2/3] remove feature from #7691 to fit version 3.2 --- workflow/usage.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index f949cf19bae..4b101af03bd 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -236,9 +236,6 @@ This means that each event has access to the following information: :method:`Symfony\\Component\\Workflow\\Event\\Event::getTransition` Returns the :class:`Symfony\\Component\\Workflow\\Transition` that dispatches the event -:method:`Symfony\\Component\\Workflow\\Event\\Event::getWorkflowName` - Returns the name of the workflow that triggers the event - For Guard Events, there is an extended class :class:`Symfony\\Component\\Workflow\\Event\\GuardEvent`. This class has two more methods: :method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::isBlocked` From 701f160db28b1ad816a9add2406c76a0c8764dde Mon Sep 17 00:00:00 2001 From: Jan Grubenbecher Date: Tue, 11 Apr 2017 15:31:44 +0200 Subject: [PATCH 3/3] Fix formating issues in the text --- workflow/usage.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index 4b101af03bd..7f6ce9d9f36 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -222,29 +222,29 @@ could easily enable logging:: $subscriber = new AuditTrailListener($logger); $dispatcher->addSubscriber($subscriber); -Event methods +Event Methods ~~~~~~~~~~~~~ + Each workflow event is an instance of :class:`Symfony\\Component\\Workflow\\Event\\Event`. 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 + Returns the :class:`Symfony\\Component\\Workflow\\Marking` of the workflow. :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 + 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: +For Guard Events, there is an extended class :class:`Symfony\\Component\\Workflow\\Event\\GuardEvent`. +This class has two more methods: :method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::isBlocked` - Returns if transition is blocked + Returns if transition is blocked. :method:`Symfony\\Component\\Workflow\\Event\\GuardEvent::setBlocked` - Sets the blocked value - - + Sets the blocked value. Usage in Twig -------------