This topic contains 1 reply, has 1 voice, and was last updated by Frank 4 years, 9 months ago.
- Topic
Hi there,
I want to extend some service-class:
Oro\Bundle\ShoppingListBundle\Manager\CurrentShoppingListManager.phpSo, I have done the following steps:
1. created/registered extended bundle: MyShoppingListBundle
2. extended some controller, calling there the custom container-service
‘my_shopping_list.manager.current_buo_shopping_list’1$currentShoppingListManager = $this->get('my_shopping_list.manager.current_buo_shopping_list');3. created custom service class:
MyShoppingListBundle\Manager\CurrentBuoShoppingListManager.php
(remaining it empty for testing, it should be work identical to Oro-CurrentShoppingListManager.php)123456789101112<?phpnamespace MyShoppingListCeExtendedBundle\Manager;use Oro\Bundle\ShoppingListBundle\Manager\CurrentShoppingListManager;class CurrentBuoShoppingListManager extends CurrentShoppingListManager{}4. Registered the container-service for step 2., creating
MyShoppingListBundle/Resources/config/services.yml12345678910111213141516parameters:my_shopping_list.manager.current_buo_shopping_list.class:MyShoppingListCeExtendedBundle\Manager\CurrentBuoShoppingListManagerservices:my_shopping_list.manager.current_buo_shopping_list:class: '%my_shopping_list.manager.current_buo_shopping_list.class%'arguments:- "@oro_shopping_list.manager.shopping_list"- "@oro_shopping_list.manager.guest_shopping_list"- '@oro_shopping_list.shopping_list_provider.cache'- "@doctrine"- "@oro_security.acl_helper"- "@oro_security.token_accessor"- "@oro_website.manager"After clearing dev-cache, and performing the addToShopping-List button-click ,
the ajax-called Url throws an exception:You have requested a non-existent service “my_shopping_list.manager.current_buo_shopping_list”.
Did you mean one of these: “oro_shopping_list.manager.current_shopping_list”,
“oro_shopping_list.manager.guest_shopping_list”, “oro_shopping_list.manager.shopping_list”?Searching the oro-docs I found:
https://oroinc.com/orocrm/doc/2.6/architecture/customization#symfony-replace-servicesSo, I tagged the service:
123456789101112131415161718parameters:my_shopping_list.manager.current_buo_shopping_list.class:MyShoppingListCeExtendedBundle\Manager\CurrentBuoShoppingListManagerservices:my_shopping_list.manager.current_buo_shopping_list:class: '%my_shopping_list.manager.current_buo_shopping_list.class%'arguments:- "@oro_shopping_list.manager.shopping_list"- "@oro_shopping_list.manager.guest_shopping_list"- '@oro_shopping_list.shopping_list_provider.cache'- "@doctrine"- "@oro_security.acl_helper"- "@oro_security.token_accessor"- "@oro_website.manager"tags:- {name: oro_shopping_list.manager.current_shopping_list}Result was the same:
You have requested a non-existent service “my_shopping_list.manager.current_buo_shopping_list”.
Did you mean one of these: “oro_shopping_list.manager.current_shopping_list”,
“oro_shopping_list.manager.guest_shopping_list”, “oro_shopping_list.manager.shopping_list”?What I am doing wrong?
More documentation, or ome use case would be great.
Many thanks for help.
Frank
The forum ‘OroPlatform’ is closed to new topics and replies.