entityManager->getRepository(Client::class)->findOneBy(['uuid' => $clientUuid]); if (!$client || $client->getSubnet() !== $data) { throw new ValidatorException('Client not found'); } if (!$data->getId()) { throw new ValidatorException('Data URL is required'); } $params = [ 'json' => [ 'macAddress' => strtolower($client->getMac()), ] ]; $content = $this->createRequest('DELETE', 'http://'.$this->ogDhcpApiUrl.'/ogdhcp/v1/subnets/'.$data->getServerId().'/hosts', $params); $data->removeClient($client); $this->entityManager->persist($data); $this->entityManager->flush(); return new JsonResponse(data: $content, status: Response::HTTP_OK); } }