• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/engine/access/holdentity.php
  • Класс: BitrixRestEngineAccessHoldEntity
  • Вызов: HoldEntity::add
static function add(string $type, string $code) : array
{
	$result = [
		'success' => false
	];

	$data = static::get();
	if (!is_array($data[$type]) || !in_array($code, $data[$type]))
	{
		$data[$type][] = $code;
		$result['success'] = static::set($data);
		if ($result['success'])
		{
			$url = static::getUrl($type, $code);
			Notification::set(static::NOTIFICATION_CODE, $url);
		}
	}

	return $result;
}