bigperson/exchange1c-symfony-bridge

bigperson/exchange1c 使用 symfony 组件的桥梁

v1.0.1 2023-12-25 13:52 UTC

This package is auto-updated.

Last update: 2024-08-25 15:12:58 UTC


README

Packagist Packagist Packagist Travis (.org) Codecov StyleCI

简单的适配器,用于将 symfony/event-dispatcher 包与https://github.com/bigperson/exchange1c 包一起使用

安装

composer require bigperson/exchange1c-symfony-bridge

使用

只需创建一个 Bigperson\Exchange1CSymfonyBridge\SymfonyEventDispatcher 的实例,并在构造函数中传递一个 Symfony\Component\EventDispatcher\EventDispatcherInterface 类的实例。然后,在服务中使用生成的适配器实例。

use Bigperson\Exchange1C\Interfaces\EventInterface;
use Bigperson\Exchange1CSymfonyBridge\SymfonyEventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcher;

$symfonyDispatcher = new EventDispatcher();
$bridgeDispatcher = new SymfonyEventDispatcher($symfonyDispatcher);
...

$categoryService = new \Bigperson\Exchange1C\Services\CategoryService($request, $config, $bridgeDispatcher, $modelBuilder);