Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Nikolaev committed Dec 21, 2020
1 parent ad4f221 commit ca83193
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
- UTM subscriber for the adding UTM in session
- Lead factory

6.2.0:

- Alias client service.
6.2.0: Replace ClientInterface::call() with send().
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# DarvinBitrix24Bundle
DarvinBitrix24Bundle
====================

This bundle provides Bitrix24 integration for Symfony-based applications.

## Usage

```php
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);
```

0 comments on commit ca83193

Please sign in to comment.