File tree 1 file changed +1
-23
lines changed
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``::
275
275
}
276
276
}
277
277
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
-
300
278
.. tip ::
301
279
302
280
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::
1051
1029
1052
1030
// $transition = ...; (an instance of Transition)
1053
1031
1054
- // $workflow is a Workflow instance retrieved from the Registry or injected directly (see above)
1032
+ // $workflow is an injected Workflow instance
1055
1033
$title = $workflow->getMetadataStore()->getMetadata('title', $transition);
1056
1034
$this->addFlash('info', "You have successfully applied the transition with title: '$title'");
1057
1035
You can’t perform that action at this time.
0 commit comments