Working with two Object Managers

14 views
Skip to first unread message

Brais De Sousa Díaz

unread,
Mar 4, 2015, 6:14:07 AM3/4/15
to syliu...@googlegroups.com
Hi EveryOne!, i'm getting in a problem with sylius and I cannot see the right way to do it. Please, can anyone give some advice?

On my App I have 4 EntityManagers with different purposes, two of them have the same entitties in different Databases, as a example, on the two Managers I need a Country Table, which i'm trying to extend from Sylius. The problem is that Sylius does not agree with this idea, i've tried to create resources with SyliusResourceBundle, 
sylius_resource:
  resources:
        siweb_backend.country:
            driver: doctrine/orm
            object_manager: default
            classes:
                model: BDSTestBundle\Entity\Country
        siweb_frontend.country:
            driver: doctrine/orm
            object_manager: nodefault
            classes:
                model: BDSTestBundle\Entity\Country

Removing the sylius_addressing from config.yml, but I still having the same problem
  [Doctrine\ORM\Mapping\MappingException]                                                                                                                                                     
  No identifier/primary key specified for Entity "BDS\TestBundle\Entity\Country" sub class of "Sylius\Component\Addressing\Model\Country". Every Entity must have an identifier/primary key.  
                

Is there a clean way to work with two object managers?
Reply all
Reply to author
Forward
0 new messages