Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add additional informations about FQCN services #1919

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modules/concepts/services/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ To do it: you declare your new service using the old service name. So if you wan

That's done. The service registered under the name `prestashop.core.b2b.b2b_feature` is now your service. The previous `prestashop.core.b2b.b2b_feature` is gone.

Since {{< minver v=8.1 >}}, some service definitions have been updated to rely on FQCN. Nothing changes, just name your service after the original FQCN:

Example :
If you want override this following service
```yml
PrestaShop\PrestaShop\Adapter\ImageManager:
arguments: [ '@PrestaShop\PrestaShop\Adapter\LegacyContext' ]
```
you can do this in your `config/services.yml`:
```yml
PrestaShop\PrestaShop\Adapter\ImageManager:
class: YourCompany\YourModule\YourService
arguments: [ '@prestashop.adapter.legacy.context' ]
```

#### Decorate the service

When you choose to decorate a service, this means that you _make everybody use your service but you keep the old service available_. The previous service has been given a new name and can still be used. Every other part of the code where this service was used will use the new version.
Expand Down