integer public static \Bitrix\Main\Entity\DataManager::getCount( array $filter = array() );
This static method executes COUNT query for an entity and returns a result.