You are here

public function ChainCheckoutFlowResolver::resolve in Commerce Core 8.2

Resolves the checkout flow.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: The order that is being checked out.

Return value

\Drupal\commerce_checkout\Entity\CheckoutFlowInterface The checkout flow, if resolved. Otherwise NULL, indicating that the next resolver in the chain should be called.

Overrides CheckoutFlowResolverInterface::resolve

File

modules/checkout/src/Resolver/ChainCheckoutFlowResolver.php, line 47

Class

ChainCheckoutFlowResolver
Default implementation of the chain checkout flow resolver.

Namespace

Drupal\commerce_checkout\Resolver

Code

public function resolve(OrderInterface $order) {
  foreach ($this->resolvers as $resolver) {
    $result = $resolver
      ->resolve($order);
    if ($result instanceof CheckoutFlowInterface) {
      return $result;
    }
  }
  return NULL;
}