plugin/drop-zone/Controller/API/DropzoneController.php
public function updateAction(Dropzone $dropzone, Request $request)
    {
        $this->checkPermission('EDIT', $dropzone->getResourceNode(), [], true);

        try {
            $this->manager->update($dropzone, json_decode($request->getContent(), true));

            $closedDropStates = [
                Dropzone::STATE_FINISHED,
                Dropzone::STATE_PEER_REVIEW,
                Dropzone::STATE_WAITING_FOR_PEER_REVIEW,
            ];

            if (!$dropzone->getDropClosed() && $dropzone->getManualPlanning() && in_array($dropzone->getManualState(), $closedDropStates)) {
                $this->manager->closeAllUnfinishedDrops($dropzone);
            }

            return new JsonResponse($this->manager->serialize($dropzone));
        } catch (\Exception $e) {
            return new JsonResponse($e->getMessage(), 422);
        }
    }
public function updateAction(Dropzone $dropzone, Request $request)
    {
        $this->checkPermission('EDIT', $dropzone->getResourceNode(), [], true);

        try {
            $this->manager->update($dropzone, json_decode($request->getContent(), true));

            $closedDropStates = [
                Dropzone::STATE_FINISHED,
                Dropzone::STATE_PEER_REVIEW,
                Dropzone::STATE_WAITING_FOR_PEER_REVIEW,
            ];

            if (!$dropzone->getDropClosed() && $dropzone->getManualPlanning() && in_array($dropzone->getManualState(), $closedDropStates)) {
                $this->manager->closeAllUnfinishedDrops($dropzone);
            }

            return new JsonResponse($this->manager->serialize($dropzone));
        } catch (\Exception $e) {
            return new JsonResponse($e->getMessage(), 422);
        }
    }
public function updateAction ( Dropzone $ dropzone , Request $ request ) { $ this -> checkPermission ( 'EDIT' , $ dropzone -> getResourceNode ( ) , [ ] , true ) ; try { $ this -> manager -> update ( $ dropzone , json_decode ( $ request -> getContent ( ) , true ) ) ; $ closedDropStates = [ Dropzone :: STATE_FINISHED , Dropzone :: STATE_PEER_REVIEW , Dropzone :: STATE_WAITING_FOR_PEER_REVIEW , ] ; if ( ! $ dropzone -> getDropClosed ( ) && $ dropzone -> getManualPlanning ( ) && in_array ( $ dropzone -> getManualState ( ) , $ closedDropStates ) ) { $ this -> manager -> closeAllUnfinishedDrops ( $ dropzone ) ; } return new JsonResponse ( $ this -> manager -> serialize ( $ dropzone ) ) ; } catch ( \ Exception $ e ) { return new JsonResponse ( $ e -> getMessage ( ) , 422 ) ; } }
Updates a Dropzone resource.

@EXT\Route("/{id}", name="claro_dropzone_update")
@EXT\Method("PUT")
@EXT\ParamConverter(
"dropzone",
class="ClarolineDropZoneBundle:Dropzone",
options={"mapping": {"id": "uuid"}}
)

@param Dropzone $dropzone
@param Request  $request

@return JsonResponse
Updates a Dropzone resource .