<?php
/**
* @package Econsor\Amity
* @copyright 2023 ECONSOR GmbH
*/
declare(strict_types=1);
namespace Econsor\Amity;
use Divante\Core\Service\CustomFieldsInstaller;
use Econsor\Amity\Components\CustomFields\AmityCustomerCustomFields;
use Econsor\Amity\Components\CustomFields\AmityProductCustomFields;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
class EconsorAmity extends Plugin
{
public function install(InstallContext $installContext): void
{
$this->installCustomFields($installContext);
}
public function installCustomFields(InstallContext $installContext): void
{
/** @var CustomFieldsInstaller $customFieldSetInstaller */
$customFieldSetInstaller = $this->container->get(CustomFieldsInstaller::class);
$customFieldSetInstaller->ensureExists((new AmityProductCustomFields())->getSet(), $installContext->getContext());
$customFieldSetInstaller->ensureExists((new AmityCustomerCustomFields())->getSet(), $installContext->getContext());
}
}