Question

I have an existing Symfony2 project which I'm attempting to install and use certain bundles from the Sylius project as dependencies. Here is my problem, I've added the SyliusProductBundle and all of its dependencies; however, when I attempt to update my database schema with:

app/console doctrine:scheme:update --force

I get the following error:

[Doctrine\Common\Persistence\Mapping\MappingException]                     
Class 'Sylius\Bundle\ProductBundle\Model\ProductInterface' does not exist 

I'm not sure why this is happening, although it seems to be some sort of namespacing issue?

I have the following configuration:

sylius_resource:
    resources:
        src.user:
            driver: doctrine/orm
            templates: App:User
            classes:
                model: SRC\Bundle\UserBundle\Entity\User

sylius_product:
    driver: doctrine/orm
    classes:
        product:
            model: Sylius\Bundle\CoreBundle\Model\Product
            controller: Sylius\Bundle\CoreBundle\Controller\ProductController
            repository: Sylius\Bundle\CoreBundle\Repository\ProductRepository
            form: Sylius\Bundle\CoreBundle\Form\Type\ProductType
Was it helpful?

Solution

Please register the bundle before DoctrineBundle. This is important as we use listeners which have to be processed first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top