@@ -332,7 +332,7 @@ workflow leaves a place::
332332 public function onLeave(Event $event)
333333 {
334334 $this->logger->alert(sprintf(
335- 'Blog post (id: "%s") performed transaction "%s" from "%s" to "%s"',
335+ 'Blog post (id: "%s") performed transition "%s" from "%s" to "%s"',
336336 $event->getSubject()->getId(),
337337 $event->getTransition()->getName(),
338338 implode(', ', array_keys($event->getMarking()->getPlaces())),
@@ -356,7 +356,7 @@ Guard Events
356356There are a special kind of events called "Guard events". Their event listeners
357357are invoked every time a call to ``Workflow::can ``, ``Workflow::apply `` or
358358``Workflow::getEnabledTransitions `` is executed. With the guard events you may
359- add custom logic to decide what transitions that are valid or not. Here is a list
359+ add custom logic to decide what transitions are valid or not. Here is a list
360360of the guard event names.
361361
362362* ``workflow.guard ``
@@ -377,15 +377,16 @@ See example to make sure no blog post without title is moved to "review"::
377377 $title = $post->title;
378378
379379 if (empty($title)) {
380- // Posts with no title should not be allowed
380+ // Posts without title are not allowed
381+ // to perform the transition "to_review"
381382 $event->setBlocked(true);
382383 }
383384 }
384385
385386 public static function getSubscribedEvents()
386387 {
387388 return [
388- 'workflow.blogpost .guard.to_review' => ['guardReview'],
389+ 'workflow.blog_publishing .guard.to_review' => ['guardReview'],
389390 ];
390391 }
391392 }
0 commit comments