Shrujan Shetty
Shrujan Shetty

Reputation: 2392

Setting the entity object to request object manually before Binding the request in symfony2

I have a form which has a collection for manager which is an autocomplete textfeild.

enter image description here

While the form binds, It throws the error as it expects manager object. But the manager text field contains only simple text.

  if ($request->getMethod() === 'POST') {

                $Form->bindRequest($request);


                }

So i manually queried to access the manager object based on the manager name, but how to set it to the $request object before binding request?

Upvotes: 1

Views: 748

Answers (1)

Elnur Abdurrakhimov
Elnur Abdurrakhimov

Reputation: 44831

See the Using Data Transformers cookbook entry — it covers exactly what you want.

Upvotes: 1

Related Questions