1c-bitrix / Bitrix24 / development · 11.04.2020

Очистка корзины Bitrix24 коробка [сниппет]

use \Bitrix\Recyclebin\Internals\Models\RecyclebinTable;
use \Bitrix\Recyclebin\Recyclebin;
use \Bitrix\Main\Loader;

Loader::includeModule('recyclebin');

$list = RecyclebinTable::getList([
        'limit'  => 5000,
        'filter' => ['MODULE_ID' => 'CRM'],
        'select' => ['ID']
    ]
)->fetchAll();
foreach ($list as $item) {
    Recyclebin::remove(intval($item['ID']));
}