• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Factory.php
  • Класс: Bitrix\Crm\Service\Factory
  • Вызов: Factory::getCategoryByCode
public function getCategoryByCode(string $code): ?Category
{
	$code = trim($code);
	if (empty(trim($code)))
	{
		return null;
	}

	foreach($this->getCategories() as $category)
	{
		if ($category->getCode() === $code)
		{
			return $category;
		}
	}

	return null;
}