I am trying to create a factory for my customed FormHashValidator, which need a formHashProcess() from BaseFuncModel I register to container via getServiceConfig()
That means I need to inject BaseFuncModel::class as dependency via its __construct() method.
But I found AbstractValidator itself have a __construct($options = null), the new custom FormHashValidator extend from AbstractValidator. If I create a factory and inject dependency from __construct(), It will overwrite the AbstractValidator’s own __construct(). I don’t know what will happend if I overwrite a built-in method.
Besides, I haven’t found a sample from website which use factory to inject dependency to a custom Validator.
In this formhash validate function there is a uid param needed, which should be acquired via AuthManager’s getIdentity() method.
I tried Callback validator, failed! because it can not get uid via context.
The only way I can expect is the custom validator on condition that I can inject dependency via facotry. But I can not find any demo or document say something about it.