• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/engine/access/holdentity.php
  • Класс: BitrixRestEngineAccessHoldEntity
  • Вызов: HoldEntity::delete
static function delete(string $type, string $code) : array
{
	$result = [
		'success' => false
	];
	$data = static::get();
	if (is_array($data[$type]))
	{
		$key = array_search($code, $data[$type]);
		if ($key !== false)
		{
			if (count($data[$type]) === 1)
			{
				unset($data[$type]);
			}
			else
			{
				unset($data[$type][$key]);
			}
			$result['success'] = static::set($data);
		}
	}

	return $result;
}