RestService :: onRestAppDelete: Bitrix method

      
<?php 
//  Bitrix\Bizproc\RestService :: onRestAppDelete()
//  /dist/bitrix/modules/bizproc/lib/restservice.php:104

    
public static function onRestAppDelete(array $fields)
    {
        
$fields array_change_key_case($fieldsCASE_UPPER);
        if (empty(
$fields['APP_ID']))
            return;

        if (!
Loader::includeModule('rest'))
            return;

        
$dbRes AppTable::getById($fields['APP_ID']);
        
$app $dbRes->fetch();

        if(!
$app)
            return;

        
$iterator RestActivityTable::getList(array(
            
'select' => array('ID'),
            
'filter' => array('=APP_ID' => $app['CLIENT_ID'])
        ));

        while (
$activity $iterator->fetch())
        {
            
RestActivityTable::delete($activity['ID']);
        }

        
$iterator RestProviderTable::getList(array(
            
'select' => array('ID'),
            
'filter' => array('=APP_ID' => $app['CLIENT_ID'])
        ));

        while (
$activity $iterator->fetch())
        {
            
RestProviderTable::delete($activity['ID']);
        }
    }