• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/ordercontactcompany.php
  • Класс: Bitrix\Crm\Controller\OrderContactCompany
  • Вызов: OrderContactCompany::listAction
public function listAction(PageNavigation $pageNavigation, array $select = [], array $filter = [], array $order = []): Page
{
	$select = empty($select)? ['*']:$select;
	$order = empty($order)? ['ID'=>'ASC']:$order;

	$registry = Registry::getInstance(Registry::REGISTRY_TYPE_ORDER);
	/** @var ContactCompanyCollection $contactCompanyCollection */
	$contactCompanyCollection = $registry->get(ENTITY_CRM_CONTACT_COMPANY_COLLECTION);

	$tradeBindings = $contactCompanyCollection::getList(
		[
			'select'=>$select,
			'filter'=>$filter,
			'order'=>$order,
			'offset' => $pageNavigation->getOffset(),
			'limit' => $pageNavigation->getLimit()
		]
	)->fetchAll();

	return new Page('CLIENTS', $tradeBindings, function() use ($filter)
	{
		$registry = Registry::getInstance(Registry::REGISTRY_TYPE_ORDER);
		/** @var ContactCompanyCollection $contactCompanyCollection */
		$contactCompanyCollection = $registry->get(ENTITY_CRM_CONTACT_COMPANY_COLLECTION);

		return count(
			$contactCompanyCollection::getList(['filter'=>$filter])->fetchAll()
		);
	});
}