Skip to content

Commit 0a183ab

Browse files
committed
make ->get consistent with the doctrine way (by using class name)
1 parent 52c2ca0 commit 0a183ab

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

components/workflow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ you can retrieve a workflow from it and use it as follows::
8484
// ...
8585
// Consider that $blogPost is in place "draft" by default
8686
$blogPost = new BlogPost();
87-
$workflow = $registry->get($blogPost);
87+
$workflow = $registry->get(BlogPost::class);
8888

8989
$workflow->can($blogPost, 'publish'); // False
9090
$workflow->can($blogPost, 'to_review'); // True

workflow.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ registry in the constructor::
253253

254254
public function toReview(BlogPost $post)
255255
{
256-
$workflow = $this->workflowRegistry->get($post);
256+
$workflow = $this->workflowRegistry->get(BlogPost::class);
257257

258258
// Update the currentState on the post
259259
try {
@@ -665,7 +665,7 @@ of domain logic in your templates:
665665

666666
``workflow_has_marked_place()``
667667
Returns ``true`` if the marking of the given object has the given state.
668-
668+
669669
``workflow_transition_blockers()``
670670
Returns :class:`Symfony\\Component\\Workflow\\TransitionBlockerList` for the given transition.
671671

@@ -700,7 +700,7 @@ The following example shows these functions in action:
700700
{% if 'reviewed' in workflow_marked_places(post) %}
701701
<span class="label">Reviewed</span>
702702
{% endif %}
703-
703+
704704
{# Loop through the transition blockers #}
705705
{% for blocker in workflow_transition_blockers(post, 'publish') %}
706706
<span class="error">{{ blocker.message }}</span>
@@ -833,7 +833,7 @@ Then you can access this metadata in your controller as follows::
833833

834834
public function myAction(Registry $registry, BlogPost $post)
835835
{
836-
$workflow = $registry->get($post);
836+
$workflow = $registry->get(BlogPost::class);
837837

838838
$title = $workflow
839839
->getMetadataStore()

0 commit comments

Comments
 (0)