• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/inheritedproperty/iblockvalues.php
  • Класс: BitrixIblockInheritedPropertyIblockValues
  • Вызов: IblockValues::queryValues
public function queryValues()
{
	$result = array();
	if ($this->hasTemplates())
	{
		$connection = BitrixMainApplication::getConnection();
		$query = $connection->query("
			SELECT
				P.ID
				,P.CODE
				,P.TEMPLATE
				,P.ENTITY_TYPE
				,P.ENTITY_ID
				,IP.VALUE
			FROM
				b_iblock_iblock_iprop IP
				INNER JOIN b_iblock_iproperty P ON P.ID = IP.IPROP_ID
			WHERE
				IP.IBLOCK_ID = ".$this->iblockId."
		");

		while ($row = $query->fetch())
		{
			$result[$row["CODE"]] = $row;
		}

		if (empty($result))
		{
			$sqlHelper = $connection->getSqlHelper();
			$result = parent::queryValues();
			$fields = array(
				"IBLOCK_ID",
				"IPROP_ID",
				"VALUE",
			);
			$rows = array();
			foreach ($result as $row)
			{
				$rows[] = array(
					$this->iblockId,
					$row["ID"],
					$sqlHelper->forSql($row["VALUE"]),
				);
			}
			$this->insertValues("b_iblock_iblock_iprop", $fields, $rows);
		}
	}
	return $result;
}