class DefaultCheckoutFlowResolver in Commerce Core 8.2
Returns the order type's default checkout flow.
Hierarchy
- class \Drupal\commerce_checkout\Resolver\DefaultCheckoutFlowResolver implements CheckoutFlowResolverInterface
Expanded class hierarchy of DefaultCheckoutFlowResolver
1 string reference to 'DefaultCheckoutFlowResolver'
- commerce_checkout.services.yml in modules/
checkout/ commerce_checkout.services.yml - modules/checkout/commerce_checkout.services.yml
1 service uses DefaultCheckoutFlowResolver
File
- modules/
checkout/ src/ Resolver/ DefaultCheckoutFlowResolver.php, line 11
Namespace
Drupal\commerce_checkout\ResolverView source
class DefaultCheckoutFlowResolver implements CheckoutFlowResolverInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Constructs a new DefaultCheckoutFlowResolver object.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public function resolve(OrderInterface $order) {
/** @var \Drupal\commerce_order\Entity\OrderTypeInterface $order_type */
$order_type = $this->entityTypeManager
->getStorage('commerce_order_type')
->load($order
->bundle());
$checkout_flow_id = $order_type
->getThirdPartySetting('commerce_checkout', 'checkout_flow', 'default');
$checkout_flow = $this->entityTypeManager
->getStorage('commerce_checkout_flow')
->load($checkout_flow_id);
return $checkout_flow;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultCheckoutFlowResolver:: |
protected | property | The entity type manager. | |
DefaultCheckoutFlowResolver:: |
public | function |
Resolves the checkout flow. Overrides CheckoutFlowResolverInterface:: |
|
DefaultCheckoutFlowResolver:: |
public | function | Constructs a new DefaultCheckoutFlowResolver object. |