Closed gdiazderadaa closed 8 years ago
hi, you can indeed configure the name of the attribute and replace the default 'status' with 'status_id'. This can be done by using the statusAttribute property in the SimpleWorkflowBehavior class.
hope this helps !
Hi, thanks for the answer. Do I need to use then the status_id in the workflow class as well? Cause it'd look less readable...
Hi @gdiazderadaa , "statusAttribute" is global. Once set in the behaviors of your model, you are not going to need it in the workflow.
i want to update status. but it is still PostWorkflow/publish on status value during update to database. how to covert status to publish before save to database?
Thanks.
should i use status id converter interface?
Hi @maoneid, yes, if you want to handle the status value saved in the db, you should create a statusIdConverter class that implements the IStatusConverter interface and then initialize the statusConverter attribute of the SimpleWorkflowBehavior class with it.
You can also use the provided StatusConverter class which is a map based converter implementation (you can find an example usage in the unit test section).
ciao
Hi there! I was wondering if yii2-workflow supports foregin key column as workfow attribute, cause I'm using a related model to manage statuses dynamically, so instead 'status' col would be 'status_id'
Thanks!