You are here

public function ReferenceablePluginTypesSubscriber::onPluginTypes in Commerce Shipping 8.2

Registers the 'commerce_shipping_method' plugin type as referenceable.

Parameters

\Drupal\commerce\Event\ReferenceablePluginTypesEvent $event: The event.

File

src/EventSubscriber/ReferenceablePluginTypesSubscriber.php, line 28

Class

ReferenceablePluginTypesSubscriber

Namespace

Drupal\commerce_shipping\EventSubscriber

Code

public function onPluginTypes(ReferenceablePluginTypesEvent $event) {
  $plugin_types = $event
    ->getPluginTypes();
  $plugin_types['commerce_shipping_method'] = $this
    ->t('Shipping method');
  $event
    ->setPluginTypes($plugin_types);
}