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

CSV Import - Foreign reference issue #18

Open
CZRubik opened this issue Jul 1, 2015 · 0 comments
Open

CSV Import - Foreign reference issue #18

CZRubik opened this issue Jul 1, 2015 · 0 comments

Comments

@CZRubik
Copy link

CZRubik commented Jul 1, 2015

Hi,

I would like to ask You for help with Data-Import Bundle for SF2 used together with Sonata Admin.

Importing future is based partialy on tutorial mentioned here: http://fungus.at/2013/10/04/universal-csv-import-feature-for-sonata-admin-symfony-2/

Import module works pretty fine until I'm going to import to the Entity / Table with foreign references.

CSV looks like:
id;supplier;name;auNumber;gaNumber;dwg
0;3;Test 1;80A999990;156017213-001;AA-000012541

Supplier is the relation field to another entity.

During the import the function setValue has in the parameter $value object of the foreign entity which is correct, but as soon as the setter is fired it will finish with exception that instead of an object string was passed.

My primary entity has following setter:

public function setSupplier(\Ausys\Bundle\SupplierBundle\Entity\Supplier $supplier = null)

If you would have any idea how to fix it, I would appreciate your feedback.

Best regards,

Martin

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