You are here

public function EntityBundleInfo::invoke in Payment 8.2

Invokes the implementation.

File

src/Hook/EntityBundleInfo.php, line 42

Class

EntityBundleInfo
Implements hook_entity_bundle_info().

Namespace

Drupal\payment\Hook

Code

public function invoke() {
  $bundles = [];
  foreach ($this->paymentTypeManager
    ->getDefinitions() as $plugin_id => $definition) {
    $bundles['payment'][$plugin_id] = array(
      'label' => $definition['label'],
    );
  }
  foreach ($this->paymentMethodConfigurationManager
    ->getDefinitions() as $plugin_id => $definition) {
    $bundles['payment_method_configuration'][$plugin_id] = array(
      'label' => $definition['label'],
    );
  }
  return $bundles;
}