public function supprimerAction(OffreEmploi $offre) { $em = $this->getDoctrine()->getManager(); $document = $em->getRepository('AMiEOffreEmploiBundle:DocumentJoint')->findOneBy(array('idOffreEmploi' => $offre->getId())); if ($path = $document->getAbsolutePath()) { unlink($path); } $em->remove($document); $em->remove($offre); $em->flush(); // return $this->redirect($this->generateUrl('amie_offresemplois_offres')); $referer = $this->getRequest()->headers->get('referer'); return $this->redirect($referer); }
public function activeroffreAction(OffreEmploi $offre) { $em = $this->getDoctrine()->getManager(); $layout = $this->getLayout($em); $offre->setActif('A'); $em->persist($offre); $em->flush(); return $this->redirect($this->generateUrl('amie_user_gestion')); }