• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/user/option.php
  • Класс: BitrixImOpenLinesUserOption
  • Вызов: Option::getOption
private function getOption(string $name): ?string
{
	$cache = static::getCache($name . '_' . $this->userId);
	$cachedOption = $cache->getVars();
	if ($cachedOption !== false)
	{
		return $cachedOption ? (string)$cachedOption : null;
	}

	$option = UserOptionTable::getRow([
		'select' => [
			$name
		],
		'filter' => [
			'=USER_ID' => $this->userId,
		]
	]);

	if (!$option)
	{
		return null;
	}

	$cache->startDataCache();
	$cache->endDataCache($option[$name]);

	return $option[$name];
}