'error', 'key' => 'pageOption', 'method' => '', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_PROJECTS_UPDATE', $token); $config = json_decode($request->getContent(), true); $exportIdView = new CommonIdView( $id ); $exportTemplates = $pageQuery->getExportTemplates($exportIdView); if (is_array($exportTemplates) && !empty($exportTemplates)) { $pageTemplates = $templateQuery->readByExport($id); $body['method'] = 'getPageTemplates'; if (!$pageTemplates instanceof Exception) { $body['type'] = 'success'; $body['data'] = $pageTemplates; $respond->statusOk(); } else { $body['data'] = $pageTemplates->getMessage(); $respond->statusUnprocessableEntity(); } } else { $body['method'] = 'getExportTemplates'; $body['data'] = 'No template found.'; if ($exportTemplates instanceof Exception) { $body['data'] = $exportTemplates->getMessage(); } $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }