interface ChainPriceResolverInterface in Commerce Core 8.2
Runs the added resolvers one by one until one of them returns the price.
Each resolver in the chain can be another chain, which is why this interface extends the base price resolver one.
Hierarchy
- interface \Drupal\commerce_price\Resolver\PriceResolverInterface
- interface \Drupal\commerce_price\Resolver\ChainPriceResolverInterface
Expanded class hierarchy of ChainPriceResolverInterface
All classes that implement ChainPriceResolverInterface
6 files declare their use of ChainPriceResolverInterface
- AddToCartForm.php in modules/
cart/ src/ Form/ AddToCartForm.php - BuyXGetY.php in modules/
promotion/ src/ Plugin/ Commerce/ PromotionOffer/ BuyXGetY.php - OrderRefresh.php in modules/
order/ src/ OrderRefresh.php - PriceCalculatedFormatter.php in modules/
price/ src/ Plugin/ Field/ FieldFormatter/ PriceCalculatedFormatter.php - PriceCalculator.php in modules/
order/ src/ PriceCalculator.php
File
- modules/
price/ src/ Resolver/ ChainPriceResolverInterface.php, line 11
Namespace
Drupal\commerce_price\ResolverView source
interface ChainPriceResolverInterface extends PriceResolverInterface {
/**
* Adds a resolver.
*
* @param \Drupal\commerce_price\Resolver\PriceResolverInterface $resolver
* The resolver.
*/
public function addResolver(PriceResolverInterface $resolver);
/**
* Gets all added resolvers.
*
* @return \Drupal\commerce_price\Resolver\PriceResolverInterface[]
* The resolvers.
*/
public function getResolvers();
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ChainPriceResolverInterface:: |
public | function | Adds a resolver. | 1 |
ChainPriceResolverInterface:: |
public | function | Gets all added resolvers. | 1 |
PriceResolverInterface:: |
public | function | Resolves a price for the given purchasable entity. | 3 |