• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Badge/Badge.php
  • Класс: Bitrix\Crm\Badge\Badge
  • Вызов: Badge::getInstance
static function getInstance(string $type, string $value): Badge
{
	if ($type === self::CALL_STATUS_TYPE)
	{
		return new CallStatus($value);
	}

	if ($type === self::PAYMENT_STATUS_TYPE)
	{
		return new PaymentStatus($value);
	}

	if ($type === self::OPENLINE_STATUS_TYPE)
	{
		return new OpenLineStatus($value);
	}

	if ($type === self::REST_APP_TYPE)
	{
		return new RestAppStatus($value);
	}

	if ($type === self::SMS_STATUS_TYPE)
	{
		return new SmsStatus($value);
	}

	if ($type === self::CALENDAR_SHARING_STATUS_TYPE)
	{
		return new CalendarSharingStatus($value);
	}

	if ($type === self::TASK_STATUS_TYPE)
	{
		return new TaskStatus($value);
	}

	throw new ArgumentException('Unknown badge type: ' . $type);
}