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

How to deal with a ManyToMany Relationship ? #250

Open
numerogeek opened this issue Aug 9, 2015 · 0 comments
Open

How to deal with a ManyToMany Relationship ? #250

numerogeek opened this issue Aug 9, 2015 · 0 comments

Comments

@numerogeek
Copy link

Hi guys,

This bundle looks very great but I have some questions about some implementation.

First I have implemented an XmlReader to convert an XML files.
The XML file look like :

<?xml version="1.0" encoding="UTF-8"?>
<brands>
    <brand>
        <brand_name>Whatever the brand is</brand_name>
        <cost>100</costcost>
        <categories>
            <category>
                <categoryCode>CAT001</categoryCode>
            </category>
            <category>
                <categoryCode>CAT003</categoryCode>
            </category>
    </categories>
    </brand>
</brands>

I have two entity : brand & categories, with a ManyToMany relationship between them.

Second I have created a customDoctrineWriter (which looks like this one from @intrepion: https://github.com/ddeboer/data-import/pull/124/files )

But I keep having errors.
the loadAssociationObjectsToEntity seems to get a Proxies which can't be saved in addCategory. (Entity not found error)

Could you please show me an example of implementation with ManyToMany realtionship, and maybe what the reader should return to get it working (supposing the tagName in xml are the field's name in the entity)

thanks !

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

1 participant