Jump to content

front/back common services issue


Recommended Posts

I have service using repository which works great in back office.

I have noticed that my hook is running both back and front.

Of course, the service was not found in the front. I defined the service as in the documentation with include in 3 services.yml files. It found my service, but couldn't find My\NS\Repository\SomeRepository.php repository class.

 

Service definition

	# alias doenst work 2
	My\NS\Repository\SomeRepository:
        class: My\NS\Repository\SomeRepository
        arguments:
            $dbPrefix: '%database_prefix%'

I use Doctrine\Common\Persistence\ObjectRepository in my repository class. How to fix class My\NS\Repository\SomeRepository not found error?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More