@@ -298,7 +298,7 @@ workflow leaves a place::
298
298
public function onLeave(Event $event)
299
299
{
300
300
$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"',
302
302
$event->getSubject()->getId(),
303
303
$event->getTransition()->getName(),
304
304
implode(', ', array_keys($event->getMarking()->getPlaces())),
@@ -322,7 +322,7 @@ Guard Events
322
322
There are a special kind of events called "Guard events". Their event listeners
323
323
are invoked every time a call to ``Workflow::can ``, ``Workflow::apply `` or
324
324
``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
326
326
of the guard event names.
327
327
328
328
* ``workflow.guard ``
@@ -343,15 +343,16 @@ See example to make sure no blog post without title is moved to "review"::
343
343
$title = $post->title;
344
344
345
345
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"
347
348
$event->setBlocked(true);
348
349
}
349
350
}
350
351
351
352
public static function getSubscribedEvents()
352
353
{
353
354
return [
354
- 'workflow.blogpost .guard.to_review' => ['guardReview'],
355
+ 'workflow.blog_publishing .guard.to_review' => ['guardReview'],
355
356
];
356
357
}
357
358
}
0 commit comments