'error', 'key' => 'elementTypesTemplates', 'method' => 'templatesByExportId', 'data' => '', ]; // TODO : Add token control $exportIdView = new CommonIdView( $exportId ); $templates = $readQuery->templatesByExportId($exportIdView); if (!\is_array($templates)) { $type = \gettype($templates); $body['data'] = "Expected array, $type received"; $respond->statusUnprocessableEntity(); } else { $body['type'] = 'success'; $body['data'] = $templates; $respond->statusOk(); } return $respond->createBody($body)->respond(); } }