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

Example how to extend/override plugin's entities/fixtures/forms #55

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

igormukhingmailcom
Copy link
Collaborator

@igormukhingmailcom igormukhingmailcom commented Jun 23, 2019

Fixes #54, fixes #48.

@wittwerch
Copy link

@igormukhingmailcom Thanks a million for that PR, really helpful to start customising that awesome bundle! 👍

However the only thing that did not work was extending the fixutres.

services:
    # Fixture
    app.fixture.brand:
        class: Ono\Fixture\BrandFixture
        arguments:
            - "@loevgaard_sylius_brand.manager.brand"
            - "@app.fixture.example_factory.brand"
        tags:
            - name: sylius_fixtures.fixture

    app.fixture.example_factory.brand:
        class: Ono\Fixture\Factory\BrandExampleFactory
        parent: loevgaard_sylius_brand.fixture.example_factory.brand

The BrandFixture is identical to your code, but somehow it can't autowire it.

In DefinitionErrorExceptionPass.php line 54:
                                                                                                                                                                                                                                                                          
  Cannot autowire service "Ono\Fixture\BrandFixture": argument "$exampleFactory" of method "Sylius\Bundle\CoreBundle\Fixture\AbstractResourceFixture::__construct()" references interface "Sylius\Bundle\CoreBundle\Fixture\Factory\ExampleFactoryInterface" but no such  
   service exists. You should maybe alias this interface to one of these existing services: "app.fixture.example_factory.brand", "Ono\Fixture\Factory\BrandExampleFactory", "sylius.fixture.example_factory.payment_method", "sylius.fixture.example_factory.shipping_ca  
  tegory", "sylius.fixture.example_factory.shipping_method", "sylius.fixture.example_factory.channel", "sylius.fixture.example_factory.customer_group", "sylius.fixture.example_factory.shop_user", "sylius.fixture.example_factory.admin_user", "sylius.fixture.example  
  _factory.promotion", "sylius.fixture.example_factory.promotion_action", "sylius.fixture.example_factory.promotion_rule", "sylius.fixture.example_factory.product_association_type", "sylius.fixture.example_factory.product_association", "sylius.fixture.example_fact  
  ory.product_option", "sylius.fixture.example_factory.product_attribute", "sylius.fixture.example_factory.product_review", "sylius.fixture.example_factory.tax_category", "sylius.fixture.example_factory.tax_rate", "sylius.fixture.example_factory.taxon", "sylius.fi  
  xture.example_factory.product", "sylius.fixture.example_factory.address", "sylius.fixture.example_factory.order", "loevgaard_sylius_brand.fixture.example_factory.brand", "sylius.fixture.example_factory.api_client", "sylius.fixture.example_factory.api_access_toke  
  n".                   

Do you have an idea what that might be?

@igormukhingmailcom
Copy link
Collaborator Author

Hi, @wittwerch
Not sure, but try to disable autowire (autowire: false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add override example Brand description
2 participants