/** * @param CtoClientNotes $note * @return CtoClient */ public function addNote(CtoClientNotes $note) { $note->setClientCto($this); $this->notes->add($note); return $this; }
/** * @Route("/note/rm/{id}", name="cto_client_removeNote", requirements={"id"="\d+"}) * @param CtoClientNotes $note * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function removeCtoClientNoteAction(CtoClientNotes $note) { $ctoClient = $note->getClientCto(); /** @var EntityManager $em */ $em = $this->getDoctrine()->getManager(); $em->remove($note); $em->flush(); return $this->redirectToRoute("cto_client_show", ["slug" => $ctoClient->getSlug()]); }