You are here

public function RabbitHoleEntityPluginManager::loadSupportedGlobalForms in Rabbit Hole 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/RabbitHoleEntityPluginManager.php \Drupal\rabbit_hole\Plugin\RabbitHoleEntityPluginManager::loadSupportedGlobalForms()

Load the string IDs for the global configuration forms for entity types.

Return value

array An array of entity types and form ID strings in the form form_id => entity_type.

File

src/Plugin/RabbitHoleEntityPluginManager.php, line 113

Class

RabbitHoleEntityPluginManager
Provides the Rabbit hole entity plugin plugin manager.

Namespace

Drupal\rabbit_hole\Plugin

Code

public function loadSupportedGlobalForms() {
  $result = [];
  foreach ($this
    ->getDefinitions() as $key => $def) {
    $form_id = $this
      ->createInstance($key)
      ->getGlobalConfigFormId();
    if (isset($form_id)) {
      $result[$form_id] = $def['entityType'];
    }
  }
  return $result;
}