• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/volume/module/im.php
  • Класс: BitrixDiskVolumeModuleIm
  • Вызов: Im::getUpdateTime
static function getUpdateTime(VolumeFragment $fragment): ?BitrixMainTypeDateTime
{
	$timestampUpdate = null;
	if ($fragment->getIndicatorType() == VolumeFolder::className() || $fragment->getIndicatorType() == VolumeFolderTree::className())
	{
		$specific = $fragment->getSpecific();
		if ($specific['chat']['LAST_MESSAGE_ID'] > 0)
		{
			$message = BitrixImModelMessageTable::getById($specific['chat']['LAST_MESSAGE_ID'])->fetch();
			/** @var BitrixMainTypeDateTime $timestampUpdate */
			$timestampUpdate = $message['DATE_CREATE'];
		}
		else
		{
			$folder = $fragment->getFolder();
			if (!$folder instanceof DiskFolder)
			{
				throw new ArgumentTypeException('Fragment must be subclass of '.DiskFolder::className());
			}
			$timestampUpdate = $folder->getUpdateTime()->toUserTime();
		}
	}

	return $timestampUpdate;
}