Skip to content

Commit

Permalink
remove decorator for media.repository
Browse files Browse the repository at this point in the history
  • Loading branch information
peterojo committed Sep 19, 2023
1 parent 9add3b3 commit 095dc6a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/AdyenPaymentShopware6.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

namespace Adyen\Shopware;

use Adyen\Shopware\DependencyInjection\AdyenPaymentCompilerPass;
use Adyen\Shopware\Entity\Notification\NotificationEntityDefinition;
use Adyen\Shopware\Entity\PaymentResponse\PaymentResponseEntityDefinition;
use Adyen\Shopware\Entity\PaymentStateData\PaymentStateDataEntityDefinition;
Expand All @@ -46,9 +47,15 @@
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Doctrine\DBAL\Connection;
use Shopware\Core\System\SalesChannel\SalesChannelEntity;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class AdyenPaymentShopware6 extends Plugin
{
public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new AdyenPaymentCompilerPass());
}

public function install(InstallContext $installContext): void
{
Expand Down
15 changes: 15 additions & 0 deletions src/DependencyInjection/AdyenPaymentCompilerPass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Adyen\Shopware\DependencyInjection;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class AdyenPaymentCompilerPass implements CompilerPassInterface
{

public function process(ContainerBuilder $container)
{
$container->getDefinition('media.repository')->setDecoratedService(null);
}
}
6 changes: 3 additions & 3 deletions src/Service/ConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ class ConfigurationService
private $systemConfigService;

/**
* @var EntityRepository
* @var EntityRepository|\Shopware\Core\Content\Media\DataAbstractionLayer\MediaRepositoryDecorator
*/
private $mediaRepository;

/**
* ConfigurationService constructor.
*
* @param SystemConfigService $systemConfigService
* @param EntityRepository $mediaRepository
* @param EntityRepository|\Shopware\Core\Content\Media\DataAbstractionLayer\MediaRepositoryDecorator $mediaRepository
*/
public function __construct(
SystemConfigService $systemConfigService,
EntityRepository $mediaRepository
$mediaRepository
) {
$this->systemConfigService = $systemConfigService;
$this->mediaRepository = $mediaRepository;
Expand Down

0 comments on commit 095dc6a

Please sign in to comment.