• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/note/target.php
  • Класс: BitrixLandingNoteTarget
  • Вызов: Target::rememberLastSite
static function rememberLastSite(int $landingId): void
{
	$res = Landing::getList([
		'select' => [
			'SITE_ID',
			'SITE_TITLE' => 'SITE.TITLE',
			'SITE_TYPE' => 'SITE.TYPE'
		],
		'filter' => [
			'ID' => $landingId
		],
		'limit' => 1
	]);
	if ($row = $res->fetch())
	{
		$option = CUserOptions::getOption('landing', self::UO_CODE_NOTES_LAST, []);
		foreach ($option as $item)
		{
			if ($item['SITE_ID'] == $row['SITE_ID'])
			{
				return;
			}
		}
		$option[] = $row;
		if (count($option) > 5)
		{
			unset($option[0]);
		}
		CUserOptions::setOption('landing', self::UO_CODE_NOTES_LAST, array_values($option));
	}
}