Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit082fd04

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 occurrencesFollow-up ofsymfony/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 parents7f314f5 +aea773c commit082fd04

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 isa Workflow instance retrieved from the Registry orinjecteddirectly (see above)
1032+
// $workflow isaninjectedWorkflow instance
10551033
$title = $workflow->getMetadataStore()->getMetadata('title', $transition);
10561034
$this->addFlash('info', "You have successfully applied the transition with title: '$title'");
10571035

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp