문제

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
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top