The delegator tries to fetch a database adapter via the name Laminas\Db\Adapter\AdapterInterface from the service container and sets the adapter to the requested service. The adapter itself must be an instance of Laminas\Db\Adapter\Adapter .
Another option is to debug the delegator class for the database adapter:
You are right!!! It works when I change it into develop mode.
Before I run with php command in local and in development mode.
But I forgot that I change it into product mode when I push to gitlab.
I wanna to write a custom Validator, can I use a factory to inject dependency to the customed Validator via __construct()?
As you see in my project, I need to valid a formHash element which need to use the BaseFuncModel->formHashProcess()
I wanna to inject BaseFuncModel::class into my customed Validator.
Hi, I know this is a very late reply. I would suggest looking into LmcUser module. You’ll find record exists usage there. It may give you an idea about how to use it in your project. Thanks!
The current thread is not about how to use the validator, but how to set the database adapter. Therefore I do not see how your answer help here because this part is missing in your component.
Hi @froschdesign, you’re following this post and many posts which are on this forum. I’ve only tried to give my suggestion based on the question. My answer may not be the exact answer he/she is looking for. But might help if he/she is really trying to learn or developing something. Apologies in advance if I’ve taken this topic off the course.
The problem is: I have searched the LmcUser repository, but it does not answer the question of this forum thread. More than that, the part is completely missing.