Skip to content

Commit bc38b80

Browse files
authored
Merge pull request mesilov#162 from mesilov/issue#161
issue#161 add return prop for crm-robots
2 parents 27e39b5 + 44f223a commit bc38b80

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# bitrix24-php-sdk change log
2+
## 0.7.0 (11.07.2020)
3+
* add arguments in method `Bitrix24\Bizproc\Robot::add` for return results support
4+
25
## 0.6.2 (12.09.2019)
36
* remove in method, `processBatchCalls` remove call `handleBitrix24APILevelErrors`
47
* remove php 5.x branch in travis config

src/classes/bizproc/Robot.php

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@
1212
class Robot extends Bitrix24Entity
1313
{
1414
/**
15-
* add crm-robot
16-
*
17-
* @param string $code
18-
* @param string $handler
19-
* @param int $userId
20-
* @param array $arName
21-
* @param array $arProps
15+
* @param $code
16+
* @param $handler
17+
* @param $userId
18+
* @param $arName
19+
* @param $arProps
20+
* @param $arReturnProps
21+
* @param $isUseSubscription
22+
* @param $isUsePlacement
2223
*
2324
* @return mixed
24-
*
25-
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotadd.php
26-
*
2725
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
2826
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
2927
* @throws \Bitrix24\Exceptions\Bitrix24Exception
@@ -37,16 +35,21 @@ class Robot extends Bitrix24Entity
3735
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
3836
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
3937
*/
40-
public function add($code, $handler, $userId, $arName, $arProps)
38+
public function add($code, $handler, $userId, $arName, $arProps, $arReturnProps, $isUseSubscription, $isUsePlacement)
4139
{
42-
$arResult = $this->client->call('bizproc.robot.add',
40+
$arResult = $this->client->call(
41+
'bizproc.robot.add',
4342
array(
44-
'CODE' => $code,
45-
'HANDLER' => $handler,
46-
'AUTH_USER_ID' => $userId,
47-
'NAME' => $arName,
48-
'PROPERTIES' => $arProps,
49-
));
43+
'CODE' => $code,
44+
'HANDLER' => $handler,
45+
'AUTH_USER_ID' => $userId,
46+
'NAME' => $arName,
47+
'PROPERTIES' => $arProps,
48+
'RETURN_PROPERTIES' => $arReturnProps,
49+
'USE_PLACEMENT' => $isUsePlacement === true ? 'Y' : 'N',
50+
'USE_SUBSCRIPTION' => $isUseSubscription === true ? 'Y' : 'N',
51+
)
52+
);
5053

5154
return $arResult['result'];
5255
}
@@ -56,8 +59,6 @@ public function add($code, $handler, $userId, $arName, $arProps)
5659
*
5760
* @param $code string
5861
*
59-
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotdelete.php
60-
*
6162
* @return array
6263
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
6364
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
@@ -70,10 +71,13 @@ public function add($code, $handler, $userId, $arName, $arProps)
7071
* @throws \Bitrix24\Exceptions\Bitrix24Exception
7172
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
7273
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
74+
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotdelete.php
75+
*
7376
*/
7477
public function delete($code)
7578
{
76-
$arResult = $this->client->call('bizproc.robot.delete',
79+
$arResult = $this->client->call(
80+
'bizproc.robot.delete',
7781
array(
7882
'code' => $code,
7983
)
@@ -103,7 +107,8 @@ public function delete($code)
103107
*/
104108
public function getList()
105109
{
106-
$arResult = $this->client->call('bizproc.robot.list',
110+
$arResult = $this->client->call(
111+
'bizproc.robot.list',
107112
array()
108113
);
109114

0 commit comments

Comments
 (0)