WriterException example



        return AbstractShopConfigurationLayer::unserializeArray($values);
    }

    /** * @throws WriterException */
    public function writeValues(string $pluginName, ?int $shopId, array $data): void
    {
        $baseException = new LogicException('Cannot change values on default layer');
        throw new WriterException($baseException);
    }
}
$this->getParent()->writeValues($pluginName$shopId$data);

            return;
        }

        $pluginRepository = $this->modelManager->getRepository(Plugin::class);
        $formRepository = $this->modelManager->getRepository(Form::class);

        /** @var Plugin|null $plugin */
        $plugin = $pluginRepository->findOneBy(['name' => $pluginName]);
        if ($plugin === null) {
            throw new WriterException(sprintf('Plugin by name "%s" not found.', $pluginName));
        }

        /** @var Form|null $form */
        $form = $formRepository->findOneBy(['pluginId' => $plugin->getId()]);
        if ($form === null) {
            throw new WriterException(sprintf('Plugin form by plugin id "%u" not found.', $plugin->getId()));
        }

        $parentValues = $this->getParent()->readValues($pluginName$shopId);

        foreach ($data as $key => $value) {
            
Home | Imprint | This part of the site doesn't use cookies.