Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit e339638

Browse files
authored
Merge pull request #103 from mesilov/task#102
Task#102
2 parents 70d8f6b + 3f0b6f6 commit e339638

File tree

7 files changed

+470
-0
lines changed

7 files changed

+470
-0
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
# bitrix24-php-sdk change log
2+
## 0.6.0 (18.02.2018)
3+
* add support for `FaceTracker` entity
4+
* add presets for request timing information
5+
* add all methods for sonetgroup
6+
* add method `crm.contact.userfield.update`
7+
* add activities methods
8+
* add exception `Bitrix24PortalRenamedException`
9+
* add a pair of fields for the Lead
10+
* add requisite support
11+
* add method update to deal\userfield entity
12+
* add `Product\Property` support
13+
* add method `crm.product.delete`
14+
* add method `crm.product.fields`
15+
* add method `crm.product.property.types`
16+
* add method `crm.product.property.delete`
17+
* add methods for `\Bitrix24\CRM\Status`
18+
* add new placement presets for detail page
19+
220
## 0.5.4 (8.07.2017)
321
* add Callback for expired token. Fix pullrequest#63 by valga
422
* add method `update` in class `Bitrix24\CRM\Product`

src/classes/bizproc/Robot.php

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?php
2+
3+
namespace Bitrix24\Bizproc;
4+
5+
use Bitrix24\Bitrix24Entity;
6+
7+
/**
8+
* Class Robot
9+
*
10+
* @package Bitrix24\Placement
11+
*/
12+
class Robot extends Bitrix24Entity
13+
{
14+
/**
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
22+
*
23+
* @return mixed
24+
*
25+
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotadd.php
26+
*
27+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
28+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
29+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
30+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
31+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
32+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
33+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
34+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
35+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
36+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
37+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
38+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
39+
*/
40+
public function add($code, $handler, $userId, $arName, $arProps)
41+
{
42+
$arResult = $this->client->call('bizproc.activity.add',
43+
array(
44+
'CODE' => $code,
45+
'HANDLER' => $handler,
46+
'AUTH_USER_ID' => $userId,
47+
'NAME' => $arName,
48+
'PROPERTIES' => $arProps,
49+
));
50+
51+
return $arResult['result'];
52+
}
53+
54+
/**
55+
* delete activity
56+
*
57+
* @param $code string
58+
*
59+
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotdelete.php
60+
*
61+
* @return array
62+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
63+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
64+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
65+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
66+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
67+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
68+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
69+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
70+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
71+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
72+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
73+
*/
74+
public function delete($code)
75+
{
76+
$arResult = $this->client->call('bizproc.robot.delete',
77+
array(
78+
'code' => $code,
79+
)
80+
);
81+
82+
return $arResult['result'];
83+
}
84+
85+
/**
86+
* get list of robots
87+
*
88+
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotlist.php
89+
*
90+
* @return mixed
91+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
92+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
93+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
94+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
95+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
96+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
97+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
98+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
99+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
100+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
101+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
102+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
103+
*/
104+
public function getList()
105+
{
106+
$arResult = $this->client->call('bizproc.robot.list',
107+
array()
108+
);
109+
110+
return $arResult['result'];
111+
}
112+
}

src/classes/facetracker/client.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
/*
3+
* This file is part of the bitrix24-php-sdk package.
4+
*
5+
* © Mesilov Maxim <mesilov.maxim@gmail.com>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
namespace Bitrix24\FaceTracker;
12+
13+
use Bitrix24\Bitrix24Entity;
14+
use Bitrix24\Exceptions\Bitrix24Exception;
15+
16+
/**
17+
* Class Client
18+
*
19+
* @package Bitrix24\FaceTracker
20+
*/
21+
class Client extends Bitrix24Entity
22+
{
23+
/**
24+
* add client face to client library
25+
*
26+
* @see https://dev.1c-bitrix.ru/rest_help/faceid/face_client_add.php
27+
*
28+
* @param $clientPhoto string client base64 encoding photo
29+
*
30+
* @return array
31+
* @throws Bitrix24Exception
32+
*/
33+
public function add($clientPhoto)
34+
{
35+
return $this->client->call('face.client.add', array('PHOTO' => $clientPhoto));
36+
}
37+
38+
/**
39+
* find client face in client gallery
40+
*
41+
* @see https://dev.1c-bitrix.ru/rest_help/faceid/face_client_identify.php
42+
*
43+
* @param $clientPhoto string client base64 encoding photo
44+
* @param $isForceAdd
45+
*
46+
* @return array
47+
* @throws Bitrix24Exception
48+
*/
49+
public function identify($clientPhoto, $isForceAdd)
50+
{
51+
return $this->client->call('face.client.identify',
52+
array(
53+
'PHOTO' => $clientPhoto,
54+
'FORCE_ADD' => $isForceAdd === true ? 'Y' : 'N',
55+
)
56+
);
57+
}
58+
}

src/classes/facetracker/user.php

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/*
3+
* This file is part of the bitrix24-php-sdk package.
4+
*
5+
* © Mesilov Maxim <mesilov.maxim@gmail.com>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
namespace Bitrix24\FaceTracker;
12+
13+
use Bitrix24\Bitrix24Entity;
14+
use Bitrix24\Exceptions\Bitrix24Exception;
15+
16+
/**
17+
* Class User
18+
*
19+
* @package Bitrix24\FaceTracker
20+
*/
21+
class User extends Bitrix24Entity
22+
{
23+
/**
24+
* add user face to client library
25+
*
26+
* @param $userId int user identifier
27+
* @param $userPhoto string client base64 encoding photo
28+
*
29+
* @return array
30+
* @throws Bitrix24Exception
31+
*/
32+
public function add($userId, $userPhoto)
33+
{
34+
return $this->client->call('face.user.add',
35+
array(
36+
'PHOTO' => $userPhoto,
37+
'USER_ID' => $userId,
38+
)
39+
);
40+
}
41+
42+
/**
43+
* find user face in user gallery
44+
*
45+
* @see https://dev.1c-bitrix.ru/rest_help/faceid/face_user_identify.php
46+
*
47+
* @param $clientPhoto string client base64 encoding photo
48+
*
49+
* @return array
50+
* @throws Bitrix24Exception
51+
*/
52+
public function identify($clientPhoto)
53+
{
54+
return $this->client->call('face.user.identify',
55+
array(
56+
'PHOTO' => $clientPhoto,
57+
)
58+
);
59+
}
60+
61+
/**
62+
* delete face from user gallery
63+
*
64+
* @see https://dev.1c-bitrix.ru/rest_help/faceid/face_user_delete.php
65+
*
66+
* @param $faceId
67+
*
68+
* @return array
69+
* @throws Bitrix24Exception
70+
*/
71+
public function delete($faceId)
72+
{
73+
return $this->client->call('face.user.delete',
74+
array(
75+
'FACE_ID' => $faceId,
76+
)
77+
);
78+
}
79+
}

0 commit comments

Comments
 (0)