vendor/store.shopware.com/swagpaypal/src/Resources/config/services.php line 85

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /*
  3.  * (c) shopware AG <info@shopware.com>
  4.  * For the full copyright and license information, please view the LICENSE
  5.  * file that was distributed with this source code.
  6.  */
  7. use Shopware\Core\Checkout\Customer\Aggregate\CustomerGroup\CustomerGroupDefinition;
  8. use Shopware\Core\Checkout\Customer\CustomerDefinition;
  9. use Shopware\Core\Checkout\Order\Aggregate\OrderAddress\OrderAddressDefinition;
  10. use Shopware\Core\Checkout\Order\Aggregate\OrderLineItem\OrderLineItemDefinition;
  11. use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionDefinition;
  12. use Shopware\Core\Checkout\Order\OrderDefinition;
  13. use Shopware\Core\Checkout\Payment\PaymentMethodDefinition;
  14. use Shopware\Core\Checkout\Shipping\ShippingMethodDefinition;
  15. use Shopware\Core\Content\Category\CategoryDefinition;
  16. use Shopware\Core\Content\Media\Aggregate\MediaFolder\MediaFolderDefinition;
  17. use Shopware\Core\Content\Media\MediaDefinition;
  18. use Shopware\Core\Content\Product\Aggregate\ProductVisibility\ProductVisibilityDefinition;
  19. use Shopware\Core\Content\Product\ProductDefinition;
  20. use Shopware\Core\Content\Rule\RuleDefinition;
  21. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryForwardCompatibilityDecorator;
  22. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
  23. use Shopware\Core\Framework\MessageQueue\ScheduledTask\ScheduledTaskDefinition;
  24. use Shopware\Core\System\Country\Aggregate\CountryState\CountryStateDefinition;
  25. use Shopware\Core\System\Country\CountryDefinition;
  26. use Shopware\Core\System\Currency\CurrencyDefinition;
  27. use Shopware\Core\System\DeliveryTime\DeliveryTimeDefinition;
  28. use Shopware\Core\System\Language\LanguageDefinition;
  29. use Shopware\Core\System\SalesChannel\Aggregate\SalesChannelType\SalesChannelTypeDefinition;
  30. use Shopware\Core\System\SalesChannel\Entity\SalesChannelRepositoryInterface;
  31. use Shopware\Core\System\SalesChannel\SalesChannelDefinition;
  32. use Shopware\Core\System\Salutation\SalutationDefinition;
  33. use Shopware\Core\System\StateMachine\Aggregation\StateMachineState\StateMachineStateDefinition;
  34. use Shopware\Core\System\SystemConfig\SystemConfigDefinition;
  35. use Swag\PayPal\Pos\DataAbstractionLayer\Entity\PosSalesChannelDefinition;
  36. use Swag\PayPal\Pos\DataAbstractionLayer\Entity\PosSalesChannelInventoryDefinition;
  37. use Swag\PayPal\Pos\DataAbstractionLayer\Entity\PosSalesChannelMediaDefinition;
  38. use Swag\PayPal\Pos\DataAbstractionLayer\Entity\PosSalesChannelProductDefinition;
  39. use Swag\PayPal\Pos\DataAbstractionLayer\Entity\PosSalesChannelRunDefinition;
  40. use Swag\PayPal\Pos\DataAbstractionLayer\Entity\PosSalesChannelRunLogDefinition;
  41. use Swag\PayPal\Util\Compatibility\EntityRepositoryDecorator;
  42. use Swag\PayPal\Util\Compatibility\SalesChannelRepositoryDecorator;
  43. use Symfony\Component\Config\FileLocator;
  44. use Symfony\Component\DependencyInjection\ContainerBuilder;
  45. use Symfony\Component\DependencyInjection\Definition;
  46. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  47. use Symfony\Component\DependencyInjection\Reference;
  48. return static function (ContainerBuilder $container): void {
  49.     $loader = new XmlFileLoader($container, new FileLocator(__DIR__ '/services'));
  50.     $loader->load('administration.xml');
  51.     $loader->load('apm.xml');
  52.     $loader->load('checkout.xml');
  53.     $loader->load('client.xml');
  54.     $loader->load('dispute.xml');
  55.     $loader->load('express_checkout.xml');
  56.     $loader->load('installment.xml');
  57.     $loader->load('orders_api.xml');
  58.     $loader->load('payments_api.xml');
  59.     $loader->load('plus.xml');
  60.     $loader->load('pui.xml');
  61.     $loader->load('resource_v1.xml');
  62.     $loader->load('resource_v2.xml');
  63.     $loader->load('service_v1.xml');
  64.     $loader->load('setting.xml');
  65.     $loader->load('shipping.xml');
  66.     $loader->load('spb_checkout.xml');
  67.     $loader->load('storefront.xml');
  68.     $loader->load('util.xml');
  69.     $loader->load('webhook.xml');
  70.     $loader->load('pos/api.xml');
  71.     $loader->load('pos/command.xml');
  72.     $loader->load('pos/dal.xml');
  73.     $loader->load('pos/message_queue.xml');
  74.     $loader->load('pos/run.xml');
  75.     $loader->load('pos/schedule.xml');
  76.     $loader->load('pos/setting.xml');
  77.     $loader->load('pos/sync.xml');
  78.     $loader->load('pos/webhook.xml');
  79.     // Shopware 6.4 compatibility
  80.     if (interface_exists(EntityRepositoryInterface::class) && !class_exists(EntityRepositoryForwardCompatibilityDecorator::class)) {
  81.         $decoratedEntityNames = [
  82.             CategoryDefinition::ENTITY_NAME,
  83.             CountryDefinition::ENTITY_NAME,
  84.             CountryStateDefinition::ENTITY_NAME,
  85.             CurrencyDefinition::ENTITY_NAME,
  86.             CustomerDefinition::ENTITY_NAME,
  87.             CustomerGroupDefinition::ENTITY_NAME,
  88.             DeliveryTimeDefinition::ENTITY_NAME,
  89.             LanguageDefinition::ENTITY_NAME,
  90.             MediaDefinition::ENTITY_NAME,
  91.             MediaFolderDefinition::ENTITY_NAME,
  92.             OrderDefinition::ENTITY_NAME,
  93.             OrderAddressDefinition::ENTITY_NAME,
  94.             OrderLineItemDefinition::ENTITY_NAME,
  95.             OrderTransactionDefinition::ENTITY_NAME,
  96.             PaymentMethodDefinition::ENTITY_NAME,
  97.             PosSalesChannelDefinition::ENTITY_NAME,
  98.             PosSalesChannelInventoryDefinition::ENTITY_NAME,
  99.             PosSalesChannelMediaDefinition::ENTITY_NAME,
  100.             PosSalesChannelProductDefinition::ENTITY_NAME,
  101.             PosSalesChannelRunDefinition::ENTITY_NAME,
  102.             PosSalesChannelRunLogDefinition::ENTITY_NAME,
  103.             ProductDefinition::ENTITY_NAME,
  104.             ProductVisibilityDefinition::ENTITY_NAME,
  105.             RuleDefinition::ENTITY_NAME,
  106.             SalesChannelDefinition::ENTITY_NAME,
  107.             SalesChannelTypeDefinition::ENTITY_NAME,
  108.             SalutationDefinition::ENTITY_NAME,
  109.             ScheduledTaskDefinition::ENTITY_NAME,
  110.             ShippingMethodDefinition::ENTITY_NAME,
  111.             StateMachineStateDefinition::ENTITY_NAME,
  112.             SystemConfigDefinition::ENTITY_NAME,
  113.         ];
  114.         $definitions = [];
  115.         foreach ($decoratedEntityNames as $entityName) {
  116.             $definition = new Definition(EntityRepositoryDecorator::class);
  117.             $definition->setDecoratedService(sprintf('%s.repository'$entityName), null\PHP_INT_MIN);
  118.             $definition->setArguments([new Reference('.inner')]);
  119.             $definitions[sprintf('%s.repository.paypal_outer'$entityName)] = $definition;
  120.         }
  121.         $container->addDefinitions($definitions);
  122.     }
  123.     if (interface_exists(SalesChannelRepositoryInterface::class)) {
  124.         $definition = new Definition(SalesChannelRepositoryDecorator::class);
  125.         $definition->setDecoratedService(sprintf('sales_channel.%s.repository'ProductDefinition::ENTITY_NAME), null\PHP_INT_MIN);
  126.         $definition->setArguments([new Reference('.inner')]);
  127.         $container->addDefinitions([sprintf('sales_channel.%s.repository.paypal_outer'ProductDefinition::ENTITY_NAME) => $definition]);
  128.     }
  129. };