I've tried searching about updating data in Symfony2 but look like all tutorials need few normal steps to do this :
- Manager initialisation
$em = $this->getDoctrine()->getManager(); - Make Entity with criteria
$entity = $em->getRepository('bundle')->find($id); - Create Form
$form = $this->createForm(new Type(), $entity); - Bind with request
$editForm->handleRequest($request); - Flush data
$em->flush();
Let say that I have custom form in twig and do manual getRequest in controller $variable = $request->request->get('name');. Is there any way I can do to update this data for specific ID in entity $entity = $em->getRepository('bundle')->find($id); without create a form for flush my data?
Because I need to update this variable for many ID in my database using iteration. Let say that I have thousands data need to updated with this value. I'm worried if creating form will impact to performance and time.