-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
| Q | A |
|---|---|
| Bug report? | no |
| Feature request? | yes |
| BC Break report? | no |
| RFC? | yes |
| Symfony version | latest |
If you have an entity with a state machine attached, you can still just set any state as current and save if you're not using apply().
It would make sense to add a validator specifically enforcing the attached state machine, it would:
- figure out if the state being set is actually a valid state at all
- figure out if the state being set is a valid state from current state
- (this is debateable) try to apply the state so event listeners are able to block the transition?
It would allow for more easier integration of the component into common workflows, IMO.
Edit: if 3) is considered, listeners should probably be able to provide an explanation why they've blocked the transition (ConstraintViolationInterface or similar?)
WDYT?