• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/landingsource/dataloader.php
  • Класс: BitrixIblockLandingSourceDataLoader
  • Вызов: DataLoader::getPropertyValue
static function getPropertyValue(array $property)
	{
		$result = null;

		$multiValue = is_array($property['VALUE']);
		if (
			($multiValue && !empty($property['VALUE'])) ||
			(!$multiValue && (string)$property['VALUE'] !== '')
		)
		{
			if ($property['PROPERTY_TYPE'] == IblockPropertyTable::TYPE_FILE)
			{
				if ($multiValue)
				{
					foreach ($property['VALUE'] as $value)
					{
						$file = CFile::GetFileArray($value);
						if (!empty($file))
						{
							$result = [
								'src' => $file['SRC'],
								'alt' => ''
							];
							break;
						}
					}
				}
				else
				{
					$file = CFile::GetFileArray($property['VALUE']);
					if (!empty($file))
					{
						$result = [
							'src' => $file['SRC'],
							'alt' => ''
						];
					}
				}
			}
			else
			{
				$result = CIBlockFormatProperties::GetDisplayValue(['NAME' => ''], $property, '');

				if (empty($result))
				{
					$result = null;
				}
				elseif (is_array($result))
				{
					if (empty($result['DISPLAY_VALUE']))
						$result = null;
					elseif (is_array($result['DISPLAY_VALUE']))
						$result = implode(', ', $result['DISPLAY_VALUE']);
					else
						$result = $result['DISPLAY_VALUE'];
				}
			}
		}

		return $result;
	}