createRequest('GET', '/ogboot/v1/pxe-templates/'.$template->getName()); if ($response->getStatusCode() !== Response::HTTP_OK) { return new JsonResponse( data: 'An error occurred', status: Response::HTTP_INTERNAL_SERVER_ERROR); } $data = json_decode($response->getContent(), true); $template->setName($data['template_name']); $template->setTemplateContent($data['template_content']); $template->setSynchronized(true); $this->entityManager->persist($template); $this->entityManager->flush(); return new JsonResponse( data: $data, status: Response::HTTP_OK); } }