• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/userprops.php
  • Класс: BitrixSaleOrderUserProperties
  • Вызов: OrderUserProperties::getFirstId
static function getFirstId($personTypeId, $userId)
{
	if (empty(static::getInstance()->profiles))
	{
		static::loadFromDB(array(
			'order' => array("DATE_UPDATE" => "DESC"),
			'filter' => array(
							"PERSON_TYPE_ID" => $personTypeId,
							"USER_ID" => $userId
							),
		));
	}

	if (!empty(static::getInstance()->profiles) && is_array(static::getInstance()->profiles))
	{
		$profile = reset(static::getInstance()->profiles);
		return $profile['ID'];
	}

	return false;
}