ekino / EkinoWordpressBundle

Integrate Symfony with WordPress and WordPress with Symfony
GNU General Public License v2.0
311 stars 79 forks source link

Model return empty entity when multiple Entity Manager #105

Open lele140686 opened 8 years ago

lele140686 commented 8 years ago

Your Bundle is great but i'm trying to use it with multiple database connections. In Configuration.php you have an option that i used:

->scalarNode('entity_manager')->end()

So my bundle's configuration looks like this:

`ekino_wordpress:

table_prefix: "wp_"

wordpress_directory: "/var/www/html/wordpress"

entity_manager: "secondary"`

Where secondary is the name of one my connections. My connections's configuration looks like this:

`default_entity_manager: primary

    entity_managers:

        primary:

            connection: primary

            mappings:

                AppBundle:  ~

        secondary:

            connection: secondary

            mappings:

                EkinoWordpressBundle: ~`

Where secondary connection connects with Wordpress database. Any of your functions using services ekino.wordpress.manager.(service) returns empty entities value so any Get returns null. If i set up default_entity_manager: secondary works as it should be.

Any hint to manage this? Have you tried before? Issue with this is that I need EkinoWordpressBundle works with non-default entity_manager connection and I suppose entity_manager option into Configuration.php is for it.

Thanks and I'll appreciate a little help.

epci commented 8 years ago

hello,

same problem for me

eko commented 8 years ago

Hi @lele140686,

Have you find a solution concerning this issue? I will try to reproduce this bug.