interface PromotionOfferInterface in Commerce Core 8.2
Defines the base interface for offers.
Offers can target the entire order, or individual order items. Therefore, each offer plugin actually implements one of the child interfaces.
Hierarchy
- interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Core\Plugin\PluginFormInterface; interface \Drupal\Component\Plugin\PluginInspectionInterface
- interface \Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer\PromotionOfferInterface
Expanded class hierarchy of PromotionOfferInterface
All classes that implement PromotionOfferInterface
See also
\Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer\OrderPromotionOfferInterface
\Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer\OrderItemPromotionOfferInterface
2 files declare their use of PromotionOfferInterface
- Promotion.php in modules/
promotion/ src/ Entity/ Promotion.php - PromotionInterface.php in modules/
promotion/ src/ Entity/ PromotionInterface.php
File
- modules/
promotion/ src/ Plugin/ Commerce/ PromotionOffer/ PromotionOfferInterface.php, line 20
Namespace
Drupal\commerce_promotion\Plugin\Commerce\PromotionOfferView source
interface PromotionOfferInterface extends ConfigurableInterface, PluginFormInterface, PluginInspectionInterface {
/**
* Gets the offer entity type ID.
*
* This is the entity type ID of the entity passed to apply().
*
* @return string
* The offer's entity type ID.
*/
public function getEntityTypeId();
/**
* Applies the offer to the given entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
* @param \Drupal\commerce_promotion\Entity\PromotionInterface $promotion
* THe parent promotion.
*/
public function apply(EntityInterface $entity, PromotionInterface $promotion);
/**
* Allows an offer to clean up any modifications done to the given entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
* @param \Drupal\commerce_promotion\Entity\PromotionInterface $promotion
* THe parent promotion.
*/
public function clear(EntityInterface $entity, PromotionInterface $promotion);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
PluginFormInterface:: |
public | function | Form constructor. | 36 |
PluginFormInterface:: |
public | function | Form submission handler. | 32 |
PluginFormInterface:: |
public | function | Form validation handler. | 18 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
PromotionOfferInterface:: |
public | function | Applies the offer to the given entity. | 6 |
PromotionOfferInterface:: |
public | function | Allows an offer to clean up any modifications done to the given entity. | 1 |
PromotionOfferInterface:: |
public | function | Gets the offer entity type ID. | 1 |