getNetworkSettings(); if (!$networkSettings) { return new JsonResponse( data: 'No network settings found for this organizational unit', status: Response::HTTP_UNPROCESSABLE_ENTITY ); } foreach ($organizationalUnit->getOrganizationalUnits() as $childUnit) { if (!$childUnit->isExcludeParentChanges()) { $childUnit->updateNetworkSettingsRecursively($networkSettings); } } foreach ($organizationalUnit->getClients() as $client) { $client->setMenu($networkSettings->getMenu()); $client->setHardwareProfile($networkSettings->getHardwareProfile()); $client->setRepository($networkSettings->getRepository()); $client->setBootServer($networkSettings->getBootServer()); $client->setOgLive($networkSettings->getOgLive()); $client->setTemplate($networkSettings->getPxeTemplate()); } $this->entityManager->flush(); return new JsonResponse( data: 'Network settings propagated successfully', status: Response::HTTP_OK ); } }