'error', 'key' => 'cdf', 'method' => 'updateCdf', 'data' => '', ]; $security->isGranted('MAESTRO_PROJECT_PROJECTS_UPDATE', $request->headers->get('x-auth-token')); $orderedCdfPages = json_decode($request->getContent(), true); $uniqueOrderedCdfPages = array_values(array_unique($orderedCdfPages)); $view = new CommonIdView( $id ); $updated = $cdf->updateCdfFolios($view, $uniqueOrderedCdfPages); if (!$updated instanceof Exception) { $body['type'] = 'success'; $body['data'] = $updated; $respond->statusOK(); } else { $body['data'] = $updated->getMessage(); $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }