• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/classes/general/timeman_user.php
  • Класс: CTimeManUser
  • Вызов: CTimeManUser::_GetLastData
protected function _GetLastData($clear = false)
{
	global $CACHE_MANAGER;

	if ($clear)
	{
		CTimeManUser::$LAST_ENTRY[$this->USER_ID] = CTimeManEntry::GetLast($this->USER_ID);
		$CACHE_MANAGER->Clean($this->_cacheId(), 'b_timeman_entries');
	}
	else
	{
		if (!isset(CTimeManUser::$LAST_ENTRY[$this->USER_ID]))
		{
			if ($CACHE_MANAGER->Read(86400, $this->_cacheId(), 'b_timeman_entries'))
			{
				$DATA = $CACHE_MANAGER->Get($this->_cacheId());
			}
			else
			{
				$DATA = CTimeManEntry::GetLast($this->USER_ID);
				$CACHE_MANAGER->Set($this->_cacheId(), $DATA);
			}

			CTimeManUser::$LAST_ENTRY[$this->USER_ID] = $DATA;
		}
	}

	if (!empty(CTimeManUser::$LAST_ENTRY[$this->USER_ID]))
	{
		$lastPauseInfo = $this->getLastPauseInfo($this->USER_ID);
		if ($lastPauseInfo)
		{
			CTimeManUser::$LAST_ENTRY[$this->USER_ID]['LAST_PAUSE'] = $lastPauseInfo;
		}
		else
		{
			unset(CTimeManUser::$LAST_ENTRY[$this->USER_ID]['LAST_PAUSE']);
		}
	}

	return CTimeManUser::$LAST_ENTRY[$this->USER_ID];
}