• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/webdavstorage.php
  • Класс: CWebDavStorageCore
  • Вызов: CWebDavStorageCore::getFile
public function getFile($id, array $extra, $skipCheckId = false)
{
	if(!$skipCheckId && $this->generateId(array('ID' => $extra['id'], 'FILE' => true)) != $id)
	{
		return false;
	}
	CTimeZone::Disable();
	$storageId = $this->getStorageId();
	$options = array(
		'path' => '/',
		'depth' => '10000',
		'element_id' => (int)$extra['id'],
	);
	/** @noinspection PhpUndefinedVariableInspection */
	$element = $this
		->init()
		->getWebDav()
		->propFind($options, $files, array(
			'COLUMNS' => array(),
			'return'  => 'array',
			//todo fix to $arParentPerms = $this->GetPermissions in CWebDavIblock::_get_mixed_list()
			'PARENT_ID' => $storageId['IBLOCK_SECTION_ID'],
			'FILTER'  => array(
				'ID' => (int)$extra['id'],
				//'IBLOCK_ID' => (int)$storageId['IBLOCK_ID'],
				//'SECTION_ID' => (int)$storageId['IBLOCK_SECTION_ID'],
			),
			'NON_DROPPED_SECTION' => true,
		))
	;
	CTimeZone::Enable();
	if(!is_array($element))
	{
		return array();
	}
	//fetch first from result
	return $this->formatFileToResponse((array_shift($element['RESULT']))?: array());
}