• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Field/Number.php
  • Класс: Bitrix\Crm\Field\Number
  • Вызов: Number::getNumerator
public function getNumerator(): ?Numerator\Numerator
{
	if ($this->numerator === null)
	{
		$numeratorType = $this->getNumeratorType();
		if (!$numeratorType)
		{
			return null;
		}
		$numeratorSettings = Numerator\Numerator::getOneByType($numeratorType);
		if (!$numeratorSettings) // try to create if not found
		{
			$this->createNumeratorTemplateIfNotExists($numeratorType, $this->getByMaxNumber());
			$numeratorSettings = Numerator\Numerator::getOneByType($numeratorType);
		}

		if ($numeratorSettings)
		{
			$this->numerator = Numerator\Numerator::load($numeratorSettings['id']);
		}
	}

	return $this->numerator;
}