8000 minor #18691 [Workflow] Remove registry workflow retrieval occurrence… · symfony/symfony-docs@082fd04 · GitHub
[go: up one dir, main page]

Skip to content

Commit 082fd04

Browse files
committed
minor #18691 [Workflow] Remove registry workflow retrieval occurrences (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [Workflow] Remove registry workflow retrieval occurrences Follow-up of symfony/symfony#51227 (comment), `@lyrixx` proposed to remove "registry retrieval" occurrences in the documentation. Actually, the `Alternatively, use the registry...` part isn't present already in the 6.3 documentation. Commits ------- aea773c [Workflow] Remove registry workflow retrieval occurrences
2 parents 7f314f5 + aea773c commit 082fd04

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

workflow.rst

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff 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('ti 46C3 tle', $transition);
10561034
$this->addFlash('info', "You have successfully applied the transition with title: '$title'");
10571035

0 commit comments

Comments
 (0)
0