Skip to content

Commit

Permalink
Merge pull request #1919 from didpoule/patch-3
Browse files Browse the repository at this point in the history
docs: add additional informations about FQCN services
  • Loading branch information
kpodemski authored Feb 3, 2025
2 parents 4e7c9a2 + 82706fa commit 4f17c4e
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit 4f17c4e

Please sign in to comment.