<?php declare(strict_types=1);
namespace Okeonline\KejeDocumentImport;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
class OkeonlineKejeDocumentImport extends Plugin
{
public function install(InstallContext $installContext): void
{
parent::install($installContext);
$this->insertDocumentTypes($installContext);
}
private function insertDocumentTypes(InstallContext $installContext)
{
/** @var EntityRepositoryInterface $documentTypeRepository */
$documentTypeRepository = $this->container->get('document_type.repository');
$documentTypeRepository->upsert(
[
[
'id' => '56035056fec848d2a55466cbc084fce1',
'technicalName' => 'keje_invoice',
'name' => 'Keje Invoice'
]
], $installContext->getContext());
$documentTypeRepository->upsert(
[
[
'id' => '56035056fec848d2a55466cbc084fce2',
'technicalName' => 'keje_delivery_note',
'name' => 'Keje Delivery Note'
]
], $installContext->getContext());
}
}