public function deleteAction(Paper $paper)
    {
        $this->assertHasPermission('MANAGE_PAPERS', $paper->getExercise());

        try {
            $this->paperManager->delete($paper);
        } catch (InvalidDataException $e) {
            return new JsonResponse($e->getErrors(), 422);
        }

        return new JsonResponse(null, 204);
    }
public function deleteAction(Paper $paper)
    {
        $this->assertHasPermission('MANAGE_PAPERS', $paper->getExercise());

        try {
            $this->paperManager->delete($paper);
        } catch (InvalidDataException $e) {
            return new JsonResponse($e->getErrors(), 422);
        }

        return new JsonResponse(null, 204);
    }
public function deleteAction ( Paper $ paper ) { $ this -> assertHasPermission ( 'MANAGE_PAPERS' , $ paper -> getExercise ( ) ) ; try { $ this -> paperManager -> delete ( $ paper ) ; } catch ( InvalidDataException $ e ) { return new JsonResponse ( $ e -> getErrors ( ) , 422 ) ; } return new JsonResponse ( null , 204 ) ; }
Deletes a paper from an exercise.

@EXT\Route("/{id}", name="ujm_exercise_delete_paper")
@EXT\Method("DELETE")
@EXT\ParamConverter("paper", class="UJMExoBundle:Attempt\Paper", options={"mapping": {"id": "uuid"}})

@param Paper $paper

@return JsonResponse
Deletes a paper from an exercise .