You are here

interface ChainPriceResolverInterface in Price 2.0.x

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

Expanded class hierarchy of ChainPriceResolverInterface

All classes that implement ChainPriceResolverInterface

1 file declares its use of ChainPriceResolverInterface
PriceCalculatedFormatter.php in src/Plugin/Field/FieldFormatter/PriceCalculatedFormatter.php

File

src/Resolver/ChainPriceResolverInterface.php, line 11

Namespace

Drupal\price\Resolver
View source
interface ChainPriceResolverInterface extends PriceResolverInterface {

  /**
   * Adds a resolver.
   *
   * @param \Drupal\price\Resolver\PriceResolverInterface $resolver
   *   The resolver.
   */
  public function addResolver(PriceResolverInterface $resolver);

  /**
   * Gets all added resolvers.
   *
   * @return \Drupal\price\Resolver\PriceResolverInterface[]
   *   The resolvers.
   */
  public function getResolvers();

}

Members

Namesort descending Modifiers Type Description Overrides
ChainPriceResolverInterface::addResolver public function Adds a resolver. 1
ChainPriceResolverInterface::getResolvers public function Gets all added resolvers. 1
PriceResolverInterface::resolve public function Resolves a price for the given purchasable entity. 2