Closed MartinP7r closed 4 years ago
Hey,
After some thought I don't this it's possible to pass other data to callbacks.
But after checking symfony/workflow
, they do allow passing a context array when applying transitions. I will try to implement that and I'll get back to you!
I've tagged v2.1.0 which allows to pass additional data when checking/applying transitions.
You can read more in the Context section of the README. Let me know if that is working well for you case!
Wow, thanks so much for the swift implementation!
I'll go check it out right away 🙂
I was trying to figure out how to set variable data on the model when applying state changes.
E.g. within an application, a user can set the state of a certain model to
scheduled
and pass a date along with it. the date gets set in a different variable on the model, logic for that could be handled inside the callbacks, as long as there would be a way to pass more args withapply()
(currently it seems like onlyobject
,event
and a static string is possible?)