Skip to content

Instantly share code, notes, and snippets.

@ricfrank
Created May 29, 2013 13:41
Show Gist options
  • Save ricfrank/5670328 to your computer and use it in GitHub Desktop.
Save ricfrank/5670328 to your computer and use it in GitHub Desktop.
public function linkCustomerAction($id)
{
$customer = $this->getDoctrine()->getRepository('PugMRestDemoBundle:Customer')->find($id);
$links = $this->getRequest()->attributes->get('links');
foreach($links as $invoice){
$customer->addInvoice($invoice);
}
$this->getDoctrine()->getManager()->flush();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment