public function PromotionOfferManager::__construct in Commerce Core 8.2
Constructs a new PromotionOfferManager object.
Parameters
\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.
\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke the alter hook with.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
Overrides DefaultPluginManager::__construct
File
- modules/
promotion/ src/ PromotionOfferManager.php, line 39
Class
- PromotionOfferManager
- Manages discovery and instantiation of promotion offer plugins.
Namespace
Drupal\commerce_promotionCode
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct('Plugin/Commerce/PromotionOffer', $namespaces, $module_handler, 'Drupal\\commerce_promotion\\Plugin\\Commerce\\PromotionOffer\\PromotionOfferInterface', 'Drupal\\commerce_promotion\\Annotation\\CommercePromotionOffer');
$this
->alterInfo('commerce_promotion_offer_info');
$this
->setCacheBackend($cache_backend, 'commerce_promotion_offer_plugins');
$this->entityTypeManager = $entity_type_manager;
}