• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/businessvalue_old.php
  • Класс: BitrixSaleBusinessValueOld
  • Вызов: BusinessValueOld::getMap
static function getMap($codeName, $personTypeId = self::COMMON_PERSON_ID)
{
	static $cache = array();

	if (! $cache)
	{
		$result = BusinessValueTable::getList(array('select' => array('NAME' => 'CODE.NAME', 'PERSON_TYPE_ID', 'ENTITY', 'ITEM')));

		while ($row = $result->fetch())
			$cache[$row['PERSON_TYPE_ID']][$row['NAME']] = array($row['ENTITY'], $row['ITEM']);
	}

	$map = null;

	if ($codes = $cache[$personTypeId])
		$map = $codes[$codeName];

	if (! $map && $personTypeId && ($codes = $cache[0]))
		$map = $codes[$codeName];

	if (! $map)
		$map = array(null, null);

	return $map;
}