Skip to content

Commit 0eafd24

Browse files
committed
minor #11400 [Workflow] Update usage.rst (noniagriconomie)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #11400). Discussion ---------- [Workflow] Update usage.rst Hello, Some minors improvements/fixes on the doc I do not know if I should target another branch Commits ------- 867ef6e Update usage.rst
2 parents 77c8614 + 867ef6e commit 0eafd24

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

workflow/usage.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
322322
There are a special kind of events called "Guard events". Their event listeners
323323
are 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
326326
of 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

Comments
 (0)