interface PriceResolverInterface in Price 2.0.x
Defines the interface for price resolvers.
Hierarchy
- interface \Drupal\price\Resolver\PriceResolverInterface
Expanded class hierarchy of PriceResolverInterface
All classes that implement PriceResolverInterface
File
- src/
Resolver/ PriceResolverInterface.php, line 11
Namespace
Drupal\price\ResolverView source
interface PriceResolverInterface {
/**
* Resolves a price for the given purchasable entity.
*
* Use $context->getData('field_name', 'price') to get the name of the field
* for which the price is being resolved (e.g "price").
*
* @param \Drupal\Core\Entity\ContentEntityInterface $entity
* The entity.
* @param string $quantity
* The quantity.
* @param \Drupal\price\Context $context
* The context.
*
* @return \Drupal\price\Price|null
* A price value object, if resolved. Otherwise NULL, indicating that the
* next resolver in the chain should be called.
*/
public function resolve(ContentEntityInterface $entity, $quantity, Context $context);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PriceResolverInterface:: |
public | function | Resolves a price for the given purchasable entity. | 2 |