• Модуль: salescenter
  • Путь к файлу: ~/bitrix/modules/salescenter/lib/fields/manager.php
  • Класс: BitrixSalesCenterFieldsManager
  • Вызов: Manager::getValue
public function getValue(string $param, int $id = null)
{
	$chain = explode('.', $param);
	if(count($chain) <= 1)
	{
		return null;
	}
	$entityName = $chain[0];
	$entity = $this->getEntityByCode($entityName);
	if($entity)
	{
		if($id === null)
		{
			$id = $this->ids[$entityName];
		}
		if(!$id && $entity instanceof EntityCurrentUser)
		{
			$id = $entity->getCurrentUserId();
		}
		if(!$id)
		{
			return null;
		}
		$data = $this->getEntityData($entity, $id);
		array_shift($chain);
		if(count($chain) === 1)
		{
			return $data[$chain[0]];
		}
		else
		{
			$id = (int) $data[$chain[0].'_ID'];
			if(!$id)
			{
				$id = 0;
			}
			return $this->getValue(implode('.', $chain), $id);
		}
	}
	else
	{
		return null;
	}
}