Event is almost the same is previous one, expect this lets you to listen to a certain class to be validated.
Where Vendor\Package\Class validated class name will be placed.
If some listeners returned false, then validation method will be canceled.
Event is fired just when validation returned true, this event wont stop any further actions.
Almost same as above, but with a class name.
All events are passing a Krucas\Service\Validator\Validator object instance to manipulate it.
You can use it to validate your models, forms and other stuff, you just need to implement ValidatableInterface and you are ready.
Now we need to handle all routable models, add additional checks when validating our data, we can do this very easy when listening for some events.
// Check if our validatable object implements RoutableInterface// If it is, then add some extra rules and values for a validatorif(in_array('RoutableInterface', class_implements($validatorService->getValidatable())))
Thats it, this will inject some extra rules and values for a every Routable model instance when it is validating. After success validation you can insert some records to your db.