<?php
// Bitrix\Bizproc\RestService :: deleteActivityInternal()
// /dist/bitrix/modules/bizproc/lib/restservice.php:281
private static function deleteActivityInternal($params, $server, $isRobot = false)
{
if(!$server->getClientId())
{
throw new AccessException("Application context required");
}
$params = array_change_key_case($params, CASE_UPPER);
self::checkAdminPermissions();
self::validateActivityCode($params['CODE']);
$params['APP_ID'] = $server->getClientId();
$internalCode = self::generateInternalCode($params);
$iterator = RestActivityTable::getList(array(
'select' => array('ID'),
'filter' => array(
'=INTERNAL_CODE' => $internalCode,
'=IS_ROBOT' => $isRobot ? 'Y' : 'N'
)
));
$result = $iterator->fetch();
if (!$result)
{
throw new RestException('Activity or Robot not found!', self::ERROR_ACTIVITY_NOT_FOUND);
}
RestActivityTable::delete($result['ID']);
return true;
}