getParsedBody(); $station = $em->refetch($request->getStation()); $backendConfig = $station->getBackendConfig(); foreach (ConfigWriter::getCustomConfigurationSections() as $field) { if (isset($body[$field])) { $backendConfig->set($field, $body[$field]); } } $station->setBackendConfig($backendConfig); $em->persist($station); $em->flush(); try { $event = new WriteLiquidsoapConfiguration($station, false, false); $eventDispatcher->dispatch($event); $config = $event->buildConfiguration(); $liquidsoap->verifyConfig($config); } catch (Throwable $e) { return $response->withStatus(500)->withJson(Entity\Api\Error::fromException($e)); } return $response->withJson(Entity\Api\Status::updated()); } }