File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -265,27 +265,19 @@ machine type, use ``camelCased workflow name + StateMachine``::
265265 }
266266 }
267267
268- Alternatively, use the registry::
268+ .. versionadded :: 6.2
269269
270- use App\Entity\BlogPost;
271- use Symfony\Component\Workflow\Registry;
272-
273- class MyClass
274- {
275- private $workflowRegistry;
270+ All workflows and state machines services are tagged since in Symfony 6.2.
276271
277- public function __construct(Registry $workflowRegistry)
278- {
279- $this->workflowRegistry = $workflowRegistry;
280- }
272+ .. tip ::
281273
282- public function toReview(BlogPost $post)
283- {
284- $blogPublishingWorkflow = $this->workflowRegistry->get($post);
274+ If you want to retrieve all workflows, for documentation purposes for example,
275+ you can :doc: ` inject all services < /service_container/service_subscribers_locators >`
276+ with the following tag:
285277
286- // ...
287- }
288- }
278+ * `` workflow ``: all workflows and all state machine;
279+ * `` workflow.workflow ``: all workflows;
280+ * `` workflow.state_machine ``: all state machines.
289281
290282.. tip ::
291283
You can’t perform that action at this time.
0 commit comments