class ReferenceablePluginTypesSubscriber in Commerce Recurring Framework 8
Hierarchy
- class \Drupal\commerce_recurring\EventSubscriber\ReferenceablePluginTypesSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface uses StringTranslationTrait
Expanded class hierarchy of ReferenceablePluginTypesSubscriber
1 string reference to 'ReferenceablePluginTypesSubscriber'
1 service uses ReferenceablePluginTypesSubscriber
File
- src/
EventSubscriber/ ReferenceablePluginTypesSubscriber.php, line 10
Namespace
Drupal\commerce_recurring\EventSubscriberView source
class ReferenceablePluginTypesSubscriber implements EventSubscriberInterface {
use StringTranslationTrait;
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[CommerceEvents::REFERENCEABLE_PLUGIN_TYPES][] = [
'onPluginTypes',
];
return $events;
}
/**
* Registers the 'commerce_subscription_type' plugin type as referenceable.
*
* @param \Drupal\commerce\Event\ReferenceablePluginTypesEvent $event
* The event.
*/
public function onPluginTypes(ReferenceablePluginTypesEvent $event) {
$types = $event
->getPluginTypes();
$types['commerce_subscription_type'] = $this
->t('Subscription type');
$types['commerce_prorater'] = $this
->t('Prorater');
$event
->setPluginTypes($types);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ReferenceablePluginTypesSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
ReferenceablePluginTypesSubscriber:: |
public | function | Registers the 'commerce_subscription_type' plugin type as referenceable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |