plugin/lesson/Controller/API/ChapterController.php
public function editAction(Request $request, Lesson $lesson, Chapter $chapter)
    {
        $this->checkPermission('EDIT', $lesson->getResourceNode(), [], true);

        $this->chapterManager->updateChapter($lesson, $chapter, json_decode($request->getContent(), true));

        return new JsonResponse($this->chapterSerializer->serialize($chapter));
    }
public function editAction(Request $request, Lesson $lesson, Chapter $chapter)
    {
        $this->checkPermission('EDIT', $lesson->getResourceNode(), [], true);

        $this->chapterManager->updateChapter($lesson, $chapter, json_decode($request->getContent(), true));

        return new JsonResponse($this->chapterSerializer->serialize($chapter));
    }
public function editAction ( Request $ request , Lesson $ lesson , Chapter $ chapter ) { $ this -> checkPermission ( 'EDIT' , $ lesson -> getResourceNode ( ) , [ ] , true ) ; $ this -> chapterManager -> updateChapter ( $ lesson , $ chapter , json_decode ( $ request -> getContent ( ) , true ) ) ; return new JsonResponse ( $ this -> chapterSerializer -> serialize ( $ chapter ) ) ; }
Update existing chapter.

@EXT\Route("/chapters/{slug}", name="apiv2_lesson_chapter_update")
@EXT\Method("PUT")
@EXT\ParamConverter("chapter", class="IcapLessonBundle:Chapter", options={"mapping": {"slug": "slug"}})

@param Request $request
@param Lesson  $lesson
@param Chapter $chapter

@return JsonResponse
Update existing chapter .