symfony2 - Populate join table in symfony 2 form -



symfony2 - Populate join table in symfony 2 form -

i working on rest based sf2 back-end solution. have 1 mutual file responsible crud operations.

now, working on module responsible storing mapping between user & address. user may have multiple address 1 of them active address.

my user entity : id, name,email.... address : country, state,city.... bring together table : id,user_id,address_id,is_active.

i using "entity" field type "address" in "user" form.

scenario is, end user input user & address values (i using postman) & back-end code create rows in user & address tables & create relation between them using join_table(user_address). have followed instructions tutorial :http://www.prowebdev.us/2012/07/symfnoy2-many-to-many-relation-with.html

but now, when passing value back-end, give error:

{ "code": 400, "message": "validation failed", "errors": { "children": { "name": [], "email": [], "address": { "errors": [ "this value not valid." ] } } } }

i passing hard-coded array input insert operation not sure how can accomplish this.

$input = array('name'=>'fn','email'=>'e@example.com','address'=>array('country'=>'in'));

i not able debug going wrong or doing wrong !

can please suggest doing wrong? thanks....

enail? guess might core of problem

symfony2 entity fosrestbundle

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -