Skip to content

Commit ee34d4d

Browse files
committed
+ Lead class: added class to work with products (get/set of lead productrows)
1 parent 5cb6ce9 commit ee34d4d

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
namespace Bitrix24\CRM\Lead;
3+
use Bitrix24\Bitrix24Entity;
4+
5+
/**
6+
* Class ProductRows
7+
*/
8+
class ProductRows extends Bitrix24Entity
9+
{
10+
/**
11+
* Get list of lead products.
12+
* @link https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_productrows_get.php
13+
* @param int $id - lead id
14+
* @return array
15+
*/
16+
public function get($id)
17+
{
18+
$fullResult = $this->client->call(
19+
'crm.lead.productrows.get',
20+
array(
21+
'id' => $id
22+
)
23+
);
24+
return $fullResult;
25+
}
26+
27+
/**
28+
* Set lead products.
29+
* @link https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_productrows_set.php
30+
* @param int $id - lead id
31+
* @param array $rows - products data
32+
* @return array
33+
*/
34+
public function set($id, $rows)
35+
{
36+
$fullResult = $this->client->call(
37+
'crm.lead.productrows.set',
38+
array(
39+
'id' => $id,
40+
'rows' => $rows
41+
)
42+
);
43+
return $fullResult;
44+
}
45+
}

0 commit comments

Comments
 (0)