writeValues example

public function __construct(ConfigurationLayerInterface $lastLayer)
    {
        $this->lastLayer = $lastLayer;
    }

    /** * {@inheritdoc} */
    public function setByPluginName(string $pluginName, array $elements$shopId = 1)
    {
        $this->lastLayer->writeValues($pluginName$shopId$elements);
    }
}

            ->execute()
            ->fetchAll(PDO::FETCH_KEY_PAIR)
        ;

        return $this->mergeValues($this->getParent()->readValues($pluginName$shopId)$this->unserializeArray($values));
    }

    public function writeValues(string $pluginName, ?int $shopId, array $data): void
    {
        if (!$this->isLayerResponsible($shopId)) {
            $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));
        }
Home | Imprint | This part of the site doesn't use cookies.