src/Config/Service/ConfigService.php
public function set(string $key, $value)
    {
        $config = $this->repository->findOneBy(['key' => $key]);

        if (!$config) {
            throw new OutOfRangeException('Config "'.$key.'" does not exist.');
        }

        $config
            ->setKey($key)
            ->setValue($value);
        $this->manager->persist($config);
        $this->manager->flush();
        $this->manager->detach($config);
    }
public function set(string $key, $value)
    {
        $config = $this->repository->findOneBy(['key' => $key]);

        if (!$config) {
            throw new OutOfRangeException('Config "'.$key.'" does not exist.');
        }

        $config
            ->setKey($key)
            ->setValue($value);
        $this->manager->persist($config);
        $this->manager->flush();
        $this->manager->detach($config);
    }
Set config value

@param string $key
@param mixed $value