-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from mesilov/task#102
Task#102
- Loading branch information
Showing
7 changed files
with
470 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?php | ||
|
||
namespace Bitrix24\Bizproc; | ||
|
||
use Bitrix24\Bitrix24Entity; | ||
|
||
/** | ||
* Class Robot | ||
* | ||
* @package Bitrix24\Placement | ||
*/ | ||
class Robot extends Bitrix24Entity | ||
{ | ||
/** | ||
* add crm-robot | ||
* | ||
* @param string $code | ||
* @param string $handler | ||
* @param int $userId | ||
* @param array $arName | ||
* @param array $arProps | ||
* | ||
* @return mixed | ||
* | ||
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotadd.php | ||
* | ||
* @throws \Bitrix24\Exceptions\Bitrix24ApiException | ||
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException | ||
* @throws \Bitrix24\Exceptions\Bitrix24Exception | ||
* @throws \Bitrix24\Exceptions\Bitrix24IoException | ||
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException | ||
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException | ||
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException | ||
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException | ||
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException | ||
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException | ||
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException | ||
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException | ||
*/ | ||
public function add($code, $handler, $userId, $arName, $arProps) | ||
{ | ||
$arResult = $this->client->call('bizproc.activity.add', | ||
array( | ||
'CODE' => $code, | ||
'HANDLER' => $handler, | ||
'AUTH_USER_ID' => $userId, | ||
'NAME' => $arName, | ||
'PROPERTIES' => $arProps, | ||
)); | ||
|
||
return $arResult['result']; | ||
} | ||
|
||
/** | ||
* delete activity | ||
* | ||
* @param $code string | ||
* | ||
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotdelete.php | ||
* | ||
* @return array | ||
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException | ||
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException | ||
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException | ||
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException | ||
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException | ||
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException | ||
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException | ||
* @throws \Bitrix24\Exceptions\Bitrix24IoException | ||
* @throws \Bitrix24\Exceptions\Bitrix24Exception | ||
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException | ||
* @throws \Bitrix24\Exceptions\Bitrix24ApiException | ||
*/ | ||
public function delete($code) | ||
{ | ||
$arResult = $this->client->call('bizproc.robot.delete', | ||
array( | ||
'code' => $code, | ||
) | ||
); | ||
|
||
return $arResult['result']; | ||
} | ||
|
||
/** | ||
* get list of robots | ||
* | ||
* @see https://dev.1c-bitrix.ru/rest_help/bizproc/bizproc_robot/robotlist.php | ||
* | ||
* @return mixed | ||
* @throws \Bitrix24\Exceptions\Bitrix24ApiException | ||
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException | ||
* @throws \Bitrix24\Exceptions\Bitrix24Exception | ||
* @throws \Bitrix24\Exceptions\Bitrix24IoException | ||
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException | ||
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException | ||
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException | ||
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException | ||
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException | ||
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException | ||
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException | ||
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException | ||
*/ | ||
public function getList() | ||
{ | ||
$arResult = $this->client->call('bizproc.robot.list', | ||
array() | ||
); | ||
|
||
return $arResult['result']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
/* | ||
* This file is part of the bitrix24-php-sdk package. | ||
* | ||
* © Mesilov Maxim <mesilov.maxim@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Bitrix24\FaceTracker; | ||
|
||
use Bitrix24\Bitrix24Entity; | ||
use Bitrix24\Exceptions\Bitrix24Exception; | ||
|
||
/** | ||
* Class Client | ||
* | ||
* @package Bitrix24\FaceTracker | ||
*/ | ||
class Client extends Bitrix24Entity | ||
{ | ||
/** | ||
* add client face to client library | ||
* | ||
* @see https://dev.1c-bitrix.ru/rest_help/faceid/face_client_add.php | ||
* | ||
* @param $clientPhoto string client base64 encoding photo | ||
* | ||
* @return array | ||
* @throws Bitrix24Exception | ||
*/ | ||
public function add($clientPhoto) | ||
{ | ||
return $this->client->call('face.client.add', array('PHOTO' => $clientPhoto)); | ||
} | ||
|
||
/** | ||
* find client face in client gallery | ||
* | ||
* @see https://dev.1c-bitrix.ru/rest_help/faceid/face_client_identify.php | ||
* | ||
* @param $clientPhoto string client base64 encoding photo | ||
* @param $isForceAdd | ||
* | ||
* @return array | ||
* @throws Bitrix24Exception | ||
*/ | ||
public function identify($clientPhoto, $isForceAdd) | ||
{ | ||
return $this->client->call('face.client.identify', | ||
array( | ||
'PHOTO' => $clientPhoto, | ||
'FORCE_ADD' => $isForceAdd === true ? 'Y' : 'N', | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
/* | ||
* This file is part of the bitrix24-php-sdk package. | ||
* | ||
* © Mesilov Maxim <mesilov.maxim@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Bitrix24\FaceTracker; | ||
|
||
use Bitrix24\Bitrix24Entity; | ||
use Bitrix24\Exceptions\Bitrix24Exception; | ||
|
||
/** | ||
* Class User | ||
* | ||
* @package Bitrix24\FaceTracker | ||
*/ | ||
class User extends Bitrix24Entity | ||
{ | ||
/** | ||
* add user face to client library | ||
* | ||
* @param $userId int user identifier | ||
* @param $userPhoto string client base64 encoding photo | ||
* | ||
* @return array | ||
* @throws Bitrix24Exception | ||
*/ | ||
public function add($userId, $userPhoto) | ||
{ | ||
return $this->client->call('face.user.add', | ||
array( | ||
'PHOTO' => $userPhoto, | ||
'USER_ID' => $userId, | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* find user face in user gallery | ||
* | ||
* @see https://dev.1c-bitrix.ru/rest_help/faceid/face_user_identify.php | ||
* | ||
* @param $clientPhoto string client base64 encoding photo | ||
* | ||
* @return array | ||
* @throws Bitrix24Exception | ||
*/ | ||
public function identify($clientPhoto) | ||
{ | ||
return $this->client->call('face.user.identify', | ||
array( | ||
'PHOTO' => $clientPhoto, | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* delete face from user gallery | ||
* | ||
* @see https://dev.1c-bitrix.ru/rest_help/faceid/face_user_delete.php | ||
* | ||
* @param $faceId | ||
* | ||
* @return array | ||
* @throws Bitrix24Exception | ||
*/ | ||
public function delete($faceId) | ||
{ | ||
return $this->client->call('face.user.delete', | ||
array( | ||
'FACE_ID' => $faceId, | ||
) | ||
); | ||
} | ||
} |
Oops, something went wrong.