File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -198,11 +198,17 @@ you can get this state machine by injecting the Workflow registry service::
198
198
199
199
class SomeService
200
200
{
201
- private $stateMachine ;
201
+ private $workflows ;
202
202
203
203
public function __constructor(Registry $workflows)
204
204
{
205
- $this->stateMachine = $workflows->get('pull_request');
205
+ $this->workflows = $workflows;
206
+ }
207
+
208
+ public function someMethod()
209
+ {
210
+ $stateMachine = $this->workflows->get('pull_request');
211
+ // ...
206
212
}
207
213
208
214
// ...
Original file line number Diff line number Diff line change @@ -170,12 +170,13 @@ you can get the workflow by injecting the Workflow registry service::
170
170
171
171
// ...
172
172
use Symfony\Component\Workflow\Registry;
173
+ use App\Entity\BlogPost;
173
174
174
175
class BlogController
175
176
{
176
177
public function edit(Registry $workflows)
177
178
{
178
- $post = new \App\Entity\ BlogPost();
179
+ $post = new BlogPost();
179
180
$workflow = $workflows->get($post);
180
181
181
182
// if there are multiple workflows for the same class,
@@ -192,7 +193,7 @@ you can get the workflow by injecting the Workflow registry service::
192
193
// ...
193
194
}
194
195
195
- // See all the available transition for the post in the current state
196
+ // See all the available transitions for the post in the current state
196
197
$transitions = $workflow->getEnabledTransitions($post);
197
198
}
198
199
}
@@ -272,7 +273,7 @@ order:
272
273
* ``workflow.[workflow name].announce ``
273
274
* ``workflow.[workflow name].announce.[transition name] ``
274
275
275
- Here is an example how to enable logging for every time the ``blog_publishing ``
276
+ Here is an example of how to enable logging for every time the ``blog_publishing ``
276
277
workflow leaves a place::
277
278
278
279
use Psr\Log\LoggerInterface;
You can’t perform that action at this time.
0 commit comments