• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/task/favorite.php
  • Класс: BitrixTasksInternalsTaskFavoriteTable
  • Вызов: FavoriteTable::processPrimary
static function processPrimary($primary)
{
	if (is_array($primary) && !array_key_exists('USER_ID', $primary))
	{
		if (is_object($GLOBALS['USER']) && method_exists($GLOBALS['USER'], 'GetId'))
		{
			$primary['USER_ID'] = $GLOBALS['USER']->GetId();
		}
		else
		{
			throw new BitrixMainArgumentException('Cannot set USER_ID automatically, global USER object does not look good. Specify $primary[USER_ID] manually.');
		}
	}

	return $primary;
}