public function duplicateAction(Request $request, $id){ $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('ABundle:B')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find B entity.'); } $new_entity = clone $entity; $em = $this->getDoctrine()->getManager(); $em->persist($new_entity); $em->flush(); return $this->indexAction();}
Saturday, March 14, 2015
Symfony 2 - Duplicate an entity
Subscribe to:
Post Comments (Atom)
-
sh -c 'xfce4-screenshooter --fullscreen --save "$HOME/Pictures/Screenshots/Screenshot_$(date +%Y-%m-%d_%H:%M:%S).png"' s...
-
Known Issues Firefox 3.5 will only support color profiles as specified by ICC v2, later versions will add su...
No comments:
Post a Comment