Commit 4386b5c1 authored by Mat's avatar Mat
Browse files

hop

parent a327bfe3
......@@ -54,8 +54,6 @@ class OffreAPIController extends MasterAPIController
if ($form->isSubmitted() && $form->isValid())
{
$em = $this->getDoctrine()->getManager();
dump($form);
$em->persist($offre);
$em->flush();
return $this->api($offre);
......@@ -71,8 +69,7 @@ class OffreAPIController extends MasterAPIController
public function readByStatusAction($status)
{
$em = $this->getDoctrine()->getManager();
$offres = $em->getRepository('PotageBundle:Offre')
->findAllByStatusForRead($status);
$offres = $em->getRepository('PotageBundle:Offre')->findAllByStatusForRead($status);
return $this->api($offres);
......@@ -88,8 +85,7 @@ class OffreAPIController extends MasterAPIController
public function updateStatusAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$offre = $em->getRepository('PotageBundle:Offre')
->findOneForUpdate($id);
$offre = $em->getRepository('PotageBundle:Offre')->findOneForUpdate($id);
$form = $this->createForm(OffreStatusAPIType::class, $offre);
$form->handleRequest($request);
......@@ -115,8 +111,7 @@ class OffreAPIController extends MasterAPIController
public function deleteAction($id)
{
$em = $this->getDoctrine()->getManager();
$offre = $em->getRepository('PotageBundle:Offre')
->findOneForDelete($id);
$offre = $em->getRepository('PotageBundle:Offre')->findOneForDelete($id);
if ($offre !== null)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment