CAllCrmCompany::GetTopIDsInCategory

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmCompany
  4. GetTopIDsInCategory
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_company.php
  • Класс: \CAllCrmCompany
  • Вызов: CAllCrmCompany::GetTopIDsInCategory
static function GetTopIDsInCategory($categoryId, $top, $sortType = 'ASC', $userPermissions = null)
{
	$top = (int)$top;
	if ($top <= 0)
	{
		return [];
	}

	$sortType = mb_strtoupper($sortType) !== 'DESC' ? 'ASC' : 'DESC';

	return \Bitrix\Crm\Entity\Company::getInstance()->getTopIDs([
		'order' => ['ID' => $sortType],
		'limit' => $top,
		'filter' => ['@CATEGORY_ID' => $categoryId, '=IS_MY_COMPANY' => 'N'],
		'userPermissions' => $userPermissions
	]);
}

Добавить комментарий