createRequest($httpClient, 'GET', 'http://'.$data->getIp(). '/ogrepository/v1/images'); if (!isset($content['output']['REPOSITORY']['images'])) { return new JsonResponse(data: 'No images found', status: Response::HTTP_NOT_FOUND); } foreach ($content['output']['REPOSITORY']['images'] as $image) { $imageEntity = $this->entityManager->getRepository(Image::class)->findOneBy(['imageFullsum' => $image['fullsum']]); if (!$imageEntity) { $imageEntity = new Image(); $imageEntity->setName($image['name'].$image['type']); $imageEntity->setImageFullsum($image['fullsum']); $imageEntity->setRemotePc(false); } $this->entityManager->persist($imageEntity); } $this->entityManager->flush(); return new JsonResponse(data: $content, status: Response::HTTP_OK); } }