@@ -298,7 +298,7 @@ workflow leaves a place::
298298 public function onLeave(Event $event)
299299 {
300300 $this->logger->alert(sprintf(
301- 'Blog post (id: "%s") performed transaction "%s" from "%s" to "%s"',
301+ 'Blog post (id: "%s") performed transition "%s" from "%s" to "%s"',
302302 $event->getSubject()->getId(),
303303 $event->getTransition()->getName(),
304304 implode(', ', array_keys($event->getMarking()->getPlaces())),
@@ -322,7 +322,7 @@ Guard Events
322322There are a special kind of events called "Guard events". Their event listeners
323323are invoked every time a call to ``Workflow::can ``, ``Workflow::apply `` or
324324``Workflow::getEnabledTransitions `` is executed. With the guard events you may
325- add custom logic to decide what transitions that are valid or not. Here is a list
325+ add custom logic to decide what transitions are valid or not. Here is a list
326326of the guard event names.
327327
328328* ``workflow.guard ``
@@ -343,15 +343,16 @@ See example to make sure no blog post without title is moved to "review"::
343343 $title = $post->title;
344344
345345 if (empty($title)) {
346- // Posts with no title should not be allowed
346+ // Posts without title are not allowed
347+ // to perform the transition "to_review"
347348 $event->setBlocked(true);
348349 }
349350 }
350351
351352 public static function getSubscribedEvents()
352353 {
353354 return [
354- 'workflow.blogpost .guard.to_review' => ['guardReview'],
355+ 'workflow.blog_publishing .guard.to_review' => ['guardReview'],
355356 ];
356357 }
357358 }
0 commit comments