Closed ferllings closed 3 years ago
Hi,
the validation based on workflow events only applies to the model that holds the status
attribute (the one who triggers the validation when its status changes). That being said, Yii2 allows you to create your own validator and so, assuming you have access to the secondary model from the primary model, you could perform any validation you want in this custom validator (including validating attributes owned by the secondary model).
Again this is outside of the yii2-workflow scope but could be addressed by Yii2 Validation features.
Hope it helps 😎
Thanks, it does help. !
Hi,
Is it possible to use the validation events on a secondary model?
I have my main model A, witch holds the workflow status. But I also have a secondary B model, with additional fields that require validation on the A workflow events.