• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/template/entity/elementskuproperty.php
  • Класс: BitrixIblockTemplateEntityElementSkuProperty
  • Вызов: ElementSkuProperty::loadFromDatabase
protected function loadFromDatabase()
{
	if (!isset($this->fields) && $this->iblockId > 0 && is_array($this->ids))
	{
		$this->fields = array();
		foreach($this->ids as $id)
		{
			if ($id > 0)
			{
				$propertyList = CIBlockElement::getProperty(
					$this->iblockId,
					$id,
					array("sort" => "asc"),
					array("EMPTY" => "N")
				);
				while ($property = $propertyList->fetch())
				{
					if ($property["VALUE_ENUM"] != "")
					{
						$value = $property["VALUE_ENUM"];
					}
					elseif ($property["PROPERTY_TYPE"] === "E")
					{
						$value = new ElementPropertyElement($property["VALUE"]);
					}
					elseif ($property["PROPERTY_TYPE"] === "G")
					{
						$value = new ElementPropertySection($property["VALUE"]);
					}
					else
					{
						if($property["USER_TYPE"] <> '')
						{
							$value = new ElementPropertyUserField($property["VALUE"], $property);
						}
						else
						{
							$value = $property["VALUE"];
						}
					}

					$this->fields[$property["ID"]][] = $value;
					$this->fieldMap[$property["ID"]] = $property["ID"];
					if ($property["CODE"] != "")
						$this->fieldMap[mb_strtolower($property["CODE"])] = $property["ID"];
				}
			}
		}
	}
	return is_array($this->fields);
}