Skip to content

[Workflow] Do not talk about registry #17878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2023
Merged

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Feb 7, 2023

This is not recommended since symfony/symfony#46000

@@ -103,7 +82,6 @@ method to initialize the object property::

// ...
$blogPost = new BlogPost();
$workflow = $registry->get($blogPost);

// initiate workflow
$workflow->getMarking($blogPost);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$workflow is not defined anymore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is defined in line 55.

// ...
// Consider that $blogPost is in place "draft" by default
$blogPost = new BlogPost();
$workflow = $registry->get($blogPost);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$workflow is not defined anymore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is defined in line 55.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but shouldn't we show an example of injecting the workflow into a controller action or a service? There is no example for this, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think it's mentioned here:

Read more about the usage of the :doc:`Workflow component </workflow>` inside a Symfony application.

@javiereguiluz
Copy link
Member

Thanks Grégoire.

@javiereguiluz javiereguiluz merged commit e7ff39e into symfony:6.2 Feb 21, 2023
@lyrixx lyrixx deleted the patch-2 branch February 22, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants