@@ -332,7 +332,7 @@ workflow leaves a place::
332
332
public function onLeave(Event $event)
333
333
{
334
334
$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"',
336
336
$event->getSubject()->getId(),
337
337
$event->getTransition()->getName(),
338
338
implode(', ', array_keys($event->getMarking()->getPlaces())),
@@ -356,7 +356,7 @@ Guard Events
356
356
There are a special kind of events called "Guard events". Their event listeners
357
357
are invoked every time a call to ``Workflow::can ``, ``Workflow::apply `` or
358
358
``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
360
360
of the guard event names.
361
361
362
362
* ``workflow.guard ``
@@ -377,15 +377,16 @@ See example to make sure no blog post without title is moved to "review"::
377
377
$title = $post->title;
378
378
379
379
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"
381
382
$event->setBlocked(true);
382
383
}
383
384
}
384
385
385
386
public static function getSubscribedEvents()
386
387
{
387
388
return [
388
- 'workflow.blogpost .guard.to_review' => ['guardReview'],
389
+ 'workflow.blog_publishing .guard.to_review' => ['guardReview'],
389
390
];
390
391
}
391
392
}
0 commit comments