eZ Community » Forums » eZ Publish 5 Platform » Public API: inject repository or...
expandshrink

Public API: inject repository or particular services?

Public API: inject repository or particular services?

Friday 27 February 2015 11:24:00 am - 3 replies

Is it a good practice to inject LocationService, ContentServices etc in my own services OR is it suggested to inject only Repository and take all services from it?

Monday 02 March 2015 12:04:36 pm

It is better to inject only a service if that is all you need, we plan to make this more the case internally as well.

However which service id where you thinking of using?

Monday 02 March 2015 12:54:00 pm

Quote from André R :

However which service id where you thinking of using?

Any possible ;) E.g.
ezpublish.api.service.content
ezpublish.api.service.content_type
ezpublish.api.service.location
ezpublish.api.service.url_alias

Modified on Monday 02 March 2015 12:54:32 pm by Andrey Astakhov

Saturday 14 March 2015 1:45:27 pm

Same as André, I usually prefer individual services, unless the Repository itself is explicitly required.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from