Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
namespace Wgg\MailchimpBundle\Storage;
use Pimcore\Model\Tool\SettingsStore;
use function explode;
use function implode;
class SettingsStoreStorage implements StorageInterface
private const SCOPE = 'wgg_mailchimp';
public function read(): array
$data = [
'api_key' => '',
'server_prefix' => '',
'list_id' => [],
$ids = SettingsStore::getIdsByScope(self::SCOPE);
foreach ($ids as $id) {
/** @var SettingsStore $settingsStore */
$settingsStore = SettingsStore::get($id, self::SCOPE);
/** @var string $rawData */
$rawData = $settingsStore->getData();
$data[$id] = 'list_id' === $id ? explode(',', $rawData) : $rawData;
return $data;
public function write(string $apiKey, string $serverPrefix, array $listIds): void
SettingsStore::set('api_key', $apiKey, 'string', self::SCOPE);
SettingsStore::set('server_prefix', $serverPrefix, 'string', self::SCOPE);
SettingsStore::set('list_id', implode(',', $listIds), 'string', self::SCOPE);