darvinstudio/darvin-bitrix24-bundle

本包为基于Symfony的应用程序提供Bitrix24集成功能。

安装: 642

依赖: 0

建议: 0

安全性: 0

星级: 0

关注者: 4

分支: 0

公开问题: 0

类型:symfony-bundle

6.2.5 2021-08-24 07:08 UTC

This package is auto-updated.

Last update: 2024-09-24 14:21:23 UTC


README

本包为基于Symfony的应用程序提供Bitrix24集成功能。

用法

use Darvin\Bitrix24Bundle\Client\ClientInterface;
use Darvin\Bitrix24Bundle\Lead\LeadFactoryInterface;
use Darvin\Bitrix24Bundle\Model\CRM\ProductRow;
use Darvin\Bitrix24Bundle\Request\Command\Factory\CRM\LeadCommandFactoryInterface;
use Darvin\Bitrix24Bundle\Request\Request;

public function __construct(
    ClientInterface $client,
    LeadCommandFactoryInterface $leadCommandFactory,
    LeadFactoryInterface $leadFactory
) {
    $this->client = $client;
    $this->leadCommandFactory = $leadCommandFactory;
    $this->leadFactory = $leadFactory;
}

$request = new Request();
$request->addCommand($this->leadCommandFactory->createAddCommand($this->leadFactory->createLead('test')));
$request->addCommand($this->leadCommandFactory->createSetProductRowsCommand(new ProductRow(1)));

$result = $this->client->send($request);