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

Commitdeca2b1

Browse files
committed
minor#19551 [Workflow] Support omittingplaces option (alexandre-daubois)
This PR was merged into the 7.1 branch.Discussion----------[Workflow] Support omitting `places` optionFixes#19545Commits-------77c49b3 [Workflow] Support omitting `places` option
2 parents27de3cc +77c49b3 commitdeca2b1

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

‎workflow.rst‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ follows:
6060
supports:
6161
-App\Entity\BlogPost
6262
initial_marking:draft
63-
places:
63+
places:# defining places manually is optional
6464
-draft
6565
-reviewed
6666
-rejected
@@ -97,10 +97,13 @@ follows:
9797
</framework:marking-store>
9898
<framework:support>App\Entity\BlogPost</framework:support>
9999
<framework:initial-marking>draft</framework:initial-marking>
100+
101+
<!-- defining places manually is optional-->
100102
<framework:place>draft</framework:place>
101103
<framework:place>reviewed</framework:place>
102104
<framework:place>rejected</framework:place>
103105
<framework:place>published</framework:place>
106+
104107
<framework:transitionname="to_review">
105108
<framework:from>draft</framework:from>
106109
<framework:to>reviewed</framework:to>
@@ -135,6 +138,7 @@ follows:
135138
->type('method')
136139
->property('currentPlace');
137140
141+
// defining places manually is optional
138142
$blogPublishing->place()->name('draft');
139143
$blogPublishing->place()->name('reviewed');
140144
$blogPublishing->place()->name('rejected');
@@ -168,6 +172,17 @@ follows:
168172
``'draft'`` or ``!php/const App\Entity\BlogPost::TRANSITION_TO_REVIEW``
169173
instead of ``'to_review'``.
170174

175+
..tip::
176+
177+
You can omit the ``places`` option if your transitions define all the places
178+
that are used in the workflow. Symfony will automatically extract the places
179+
from the transitions.
180+
181+
..versionadded::7.1
182+
183+
The support for omitting the ``places`` option was introduced in
184+
Symfony 7.1.
185+
171186
The configured property will be used via its implemented getter/setter methods by the marking store::
172187

173188
// src/Entity/BlogPost.php

‎workflow/workflow-and-state-machine.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,17 @@ Below is the configuration for the pull request state machine.
252252
->to(['review']);
253253
};
254254
255+
..tip::
256+
257+
You can omit the ``places`` option if your transitions define all the places
258+
that are used in the workflow. Symfony will automatically extract the places
259+
from the transitions.
260+
261+
..versionadded::7.1
262+
263+
The support for omitting the ``places`` option was introduced in
264+
Symfony 7.1.
265+
255266
Symfony automatically creates a service for each workflow (:class:`Symfony\\Component\\Workflow\\Workflow`)
256267
or state machine (:class:`Symfony\\Component\\Workflow\\StateMachine`) you
257268
have defined in your configuration. You can use the workflow inside a class by using

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp