Skip to content

Conversation

ronfroy
Copy link
Contributor

@ronfroy ronfroy commented Feb 4, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

Returns all available transitions (without taking care of guard handlers). It's may be really useful in the case we have to get the available and not juste enabled.

@nicolas-grekas nicolas-grekas added this to the 4.1 milestone Feb 5, 2018
@lyrixx
Copy link
Member

lyrixx commented Feb 7, 2018

Hello @ronfroy

Could you describe your use case for this feature? For now, I'm a bit reluctant to add this feature to Symfony.

@ronfroy
Copy link
Contributor Author

ronfroy commented Feb 7, 2018

@lyrixx I want to validate a transition with multiple error depending of rich condition (sub entity, author...) after an user action. In my idea i get all available transition and call "->can" to generate error with guard listener.

Maybe you have a better solution?

@ronfroy
Copy link
Contributor Author

ronfroy commented Feb 7, 2018

@lyrixx Maybe we can just add a "validate" method to the workflow that call only a throw validation event.

@ronfroy
Copy link
Contributor Author

ronfroy commented Feb 7, 2018

@lyrixx https://github.com/symfony/symfony/pull/26076/files this is maybe a better way to achieve this?

@lyrixx
Copy link
Member

lyrixx commented Feb 7, 2018

With #26076 you will be able to know why a transition is blocked. I think it's the way to go indeed.

I'm closing this PR, but don't hesitate to re-open it if something is missing.

@lyrixx lyrixx closed this Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants