• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Entity/File/FileItem.php
  • Класс: BitrixImV2EntityFileFileItem
  • Вызов: FileItem::getContentType
public function getContentType(): string
{
	if (isset($this->contentType))
	{
		return $this->contentType;
	}

	if ($this->getDiskFile()->getCode() === BitrixImV2LinkFileFileItem::MEDIA_ORIGINAL_CODE)
	{
		return 'file';
	}

	$diskTypeFile = $this->getDiskFile()->getTypeFile();

	switch ($diskTypeFile)
	{
		case TypeFile::IMAGE:
			return 'image';
		case TypeFile::VIDEO:
			return 'video';
		case TypeFile::AUDIO:
			return 'audio';
		default:
			return 'file';
	}
}