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

Expected an instance of AppBundle\Entity\Product. Got: Sylius\Component\Core\Model\Product #11

Closed
h3llr4iser opened this issue Aug 28, 2017 · 1 comment

Comments

@h3llr4iser
Copy link
Contributor

h3llr4iser commented Aug 28, 2017

Hi, you have to change your association in Page.orm.yml, the target entity have to be Sylius\Component\Product\Model\ProductInterface, because if Someone extend product entity your plugin throw this error updating a page.

BitBag\CmsPlugin\Entity\Page:
    type: entity
    table: bitbag_cms_page
    id:
        id:
            type: integer
            id: true
            generator:
                strategy: AUTO
    fields:
        code:
            type: string
            length: 250
        enabled:
            type: boolean
    manyToMany:
        products:
            targetEntity: Sylius\Component\Product\Model\ProductInterface
            joinTable:
                name: bitbag_cms_page_products
                joinColumns:
                    page_id:
                        referencedColumnName: id
                inverseJoinColumns:
                    product_id:
                        referencedColumnName: id
@bitbager
Copy link
Member

Fixed in #13 🎉

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

No branches or pull requests

2 participants