• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/order/orderentitybindingschecker.php
  • Класс: Bitrix\Crm\Order\OrderEntityBindingsChecker
  • Вызов: OrderEntityBindingsChecker::hasBindingsWithPayableEntities
static function hasBindingsWithPayableEntities(int $orderId): bool
{
	$orderItemIdentifier = new \Bitrix\Crm\ItemIdentifier(\CCrmOwnerType::Order, $orderId);
	$orderRelations =
		\Bitrix\Crm\Service\Container::getInstance()
			->getRelationManager()
			->getParentElements($orderItemIdentifier)
	;
	if (empty($orderRelations))
	{
		return false;
	}

	foreach ($orderRelations as $orderRelation)
	{
		if (in_array($orderRelation->getEntityTypeId(), self::getPayableEntityTypeIds(), true))
		{
			return true;
		}
	}

	return false;
}