Skip to content

Commit

Permalink
Merge pull request #103 from mesilov/task#102
Browse files Browse the repository at this point in the history
Task#102
  • Loading branch information
mesilov authored Apr 10, 2018
2 parents 70d8f6b + 3f0b6f6 commit e339638
Show file tree
Hide file tree
Showing 7 changed files with 470 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
# bitrix24-php-sdk change log
## 0.6.0 (18.02.2018)
* add support for `FaceTracker` entity
* add presets for request timing information
* add all methods for sonetgroup
* add method `crm.contact.userfield.update`
* add activities methods
* add exception `Bitrix24PortalRenamedException`
* add a pair of fields for the Lead
* add requisite support
* add method update to deal\userfield entity
* add `Product\Property` support
* add method `crm.product.delete`
* add method `crm.product.fields`
* add method `crm.product.property.types`
* add method `crm.product.property.delete`
* add methods for `\Bitrix24\CRM\Status`
* add new placement presets for detail page

## 0.5.4 (8.07.2017)
* add Callback for expired token. Fix pullrequest#63 by valga
* add method `update` in class `Bitrix24\CRM\Product`
Expand Down
112 changes: 112 additions & 0 deletions src/classes/bizproc/Robot.php
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'];
}
}
58 changes: 58 additions & 0 deletions src/classes/facetracker/client.php
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',
)
);
}
}
79 changes: 79 additions & 0 deletions src/classes/facetracker/user.php
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,
)
);
}
}
Loading

0 comments on commit e339638

Please sign in to comment.