You are here

protected function WebformUiElementTypeFormBase::getDefinitions in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_ui/src/Form/WebformUiElementTypeFormBase.php \Drupal\webform_ui\Form\WebformUiElementTypeFormBase::getDefinitions()

Gets the sorted definition of all WebformElement plugins.

Return value

array An array of WebformElement plugin definitions. Keys are element types.

1 call to WebformUiElementTypeFormBase::getDefinitions()
WebformUiElementTypeSelectForm::buildForm in modules/webform_ui/src/Form/WebformUiElementTypeSelectForm.php
Form constructor.

File

modules/webform_ui/src/Form/WebformUiElementTypeFormBase.php, line 465

Class

WebformUiElementTypeFormBase
Provides a abstract element type webform for a webform element.

Namespace

Drupal\webform_ui\Form

Code

protected function getDefinitions() {
  $definitions = $this->elementManager
    ->getDefinitions();
  $definitions = $this->elementManager
    ->getSortedDefinitions($definitions, 'category');
  $definitions = $this->elementManager
    ->removeExcludeDefinitions($definitions);
  $grouped_definitions = $this->elementManager
    ->getGroupedDefinitions($definitions);
  $sorted_definitions = [];
  foreach ($grouped_definitions as $grouped_definition) {
    $sorted_definitions += $grouped_definition;
  }
  return $sorted_definitions;
}