File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ you can retrieve a workflow from it and use it as follows::
84
84
// ...
85
85
// Consider that $blogPost is in place "draft" by default
86
86
$blogPost = new BlogPost();
87
- $workflow = $registry->get($blogPost );
87
+ $workflow = $registry->get(BlogPost::class );
88
88
89
89
$workflow->can($blogPost, 'publish'); // False
90
90
$workflow->can($blogPost, 'to_review'); // True
Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ registry in the constructor::
253
253
254
254
public function toReview(BlogPost $post)
255
255
{
256
- $workflow = $this->workflowRegistry->get($post );
256
+ $workflow = $this->workflowRegistry->get(BlogPost::class );
257
257
258
258
// Update the currentState on the post
259
259
try {
@@ -665,7 +665,7 @@ of domain logic in your templates:
665
665
666
666
``workflow_has_marked_place() ``
667
667
Returns ``true `` if the marking of the given object has the given state.
668
-
668
+
669
669
``workflow_transition_blockers() ``
670
670
Returns :class: `Symfony\\ Component\\ Workflow\\ TransitionBlockerList ` for the given transition.
671
671
@@ -700,7 +700,7 @@ The following example shows these functions in action:
700
700
{% if 'reviewed' in workflow_marked_places(post) %}
701
701
<span class="label">Reviewed</span>
702
702
{% endif %}
703
-
703
+
704
704
{# Loop through the transition blockers #}
705
705
{% for blocker in workflow_transition_blockers(post, 'publish') %}
706
706
<span class="error">{{ blocker.message }}</span>
@@ -833,7 +833,7 @@ Then you can access this metadata in your controller as follows::
833
833
834
834
public function myAction(Registry $registry, BlogPost $post)
835
835
{
836
- $workflow = $registry->get($post );
836
+ $workflow = $registry->get(BlogPost::class );
837
837
838
838
$title = $workflow
839
839
->getMetadataStore()
You can’t perform that action at this time.
0 commit comments