File tree Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -275,28 +275,6 @@ machine type, use ``camelCased workflow name + StateMachine``::
275275 }
276276 }
277277
278- Alternatively, use the registry::
279-
280- use App\Entity\BlogPost;
281- use Symfony\Component\Workflow\Registry;
282-
283- class MyClass
284- {
285- private $workflowRegistry;
286-
287- public function __construct(Registry $workflowRegistry)
288- {
289- $this->workflowRegistry = $workflowRegistry;
290- }
291-
292- public function toReview(BlogPost $post)
293- {
294- $blogPublishingWorkflow = $this->workflowRegistry->get($post);
295-
296- // ...
297- }
298- }
299-
300278.. tip ::
301279
302280 You can find the list of available workflow services with the
@@ -1051,7 +1029,7 @@ In a :ref:`flash message <flash-messages>` in your controller::
10511029
10521030 // $transition = ...; (an instance of Transition)
10531031
1054- // $workflow is a Workflow instance retrieved from the Registry or injected directly (see above)
1032+ // $workflow is an injected Workflow instance
10551033 $title = $workflow->getMetadataStore()->getMetadata('title', $transition);
10561034 $this->addFlash('info', "You have successfully applied the transition with title: '$title'");
10571035
You can’t perform that action at this time.
0 commit comments