'error', 'key' => 'pageDuplicate', 'method' => 'deleteDuplicate', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_PROJECTS_UPDATE', $token); $deleted = $query->deleteDuplicate($id); if (!$deleted instanceof Exception) { $body['type'] = 'success'; $body['data'] = $deleted; $respond->statusOK(); } else { $body['data'] = $deleted->getMessage(); $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }