You are here

public function WebformElementManager::getInstances in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElementManager.php \Drupal\webform\Plugin\WebformElementManager::getInstances()

Get all available webform element plugin instances.

Return value

\Drupal\webform\Plugin\WebformElementInterface[] An array of all available webform element plugin instances.

Overrides WebformElementManagerInterface::getInstances

2 calls to WebformElementManager::getInstances()
WebformElementManager::getAllProperties in src/Plugin/WebformElementManager.php
Get all properties for all elements.
WebformElementManager::getTranslatableProperties in src/Plugin/WebformElementManager.php
Get all translatable properties from all elements.

File

src/Plugin/WebformElementManager.php, line 141

Class

WebformElementManager
Provides a plugin manager for webform element plugins.

Namespace

Drupal\webform\Plugin

Code

public function getInstances() {
  $plugin_definitions = $this
    ->getDefinitions();
  $plugin_definitions = $this
    ->getSortedDefinitions($plugin_definitions);
  $plugin_definitions = $this
    ->removeExcludeDefinitions($plugin_definitions);

  // Initialize and return all plugin instances.
  foreach ($plugin_definitions as $plugin_id => $plugin_definition) {
    $this
      ->createInstance($plugin_id);
  }
  return $this->instances;
}