Skip to content

Instantly share code, notes, and snippets.

@jblac
Created March 5, 2013 18:04
Show Gist options
  • Save jblac/5092552 to your computer and use it in GitHub Desktop.
Save jblac/5092552 to your computer and use it in GitHub Desktop.
public function assignCaseManagerAction($id) {
$em = $this->getDoctrine()->getManager();
$customer = $this->getCustomer($id);
$request = $this->getRequest();
if (!$customer) {
throw $this->createNotFoundException('Unable to find Customer entity.');
}
$form = $this->createForm(new CustomerCaseManagerType(), $customer);
if($request->getMethod() == 'POST')
{
$form->bindRequest($request);
if ($form->isValid()) {
$em->persist($customer);
$this->getLogger()->addAccessItem($customer, $this->getUser(), "Case Manager Updated.", false);
$em->flush();
return $this->redirect($this->generateUrl('customer_show', array('id' => $id)));
}
}
return $this->render('EcsCrmBundle:Customer:caseManager.html.twig', array(
'customer' => $customer,
'form' => $form->createView(),
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment