You are here

public static function WebformAnalysisBlock::getElements in Webform Analysis 8

Get Elements.

Parameters

\Drupal\webform_analysis\WebformAnalysisInterface $analysis: Analaysis.

Return value

array Options.

2 calls to WebformAnalysisBlock::getElements()
WebformAnalysisBlock::blockForm in src/Plugin/Block/WebformAnalysisBlock.php
WebformAnalysisBlock::updateEntity in src/Plugin/Block/WebformAnalysisBlock.php
Handles switching the configuration type selector.

File

src/Plugin/Block/WebformAnalysisBlock.php, line 202

Class

WebformAnalysisBlock
Provides a 'Webform' block.

Namespace

Drupal\webform_analysis\Plugin\Block

Code

public static function getElements(WebformAnalysisInterface $analysis) {
  $options = [];
  foreach ($analysis
    ->getElements() as $element_name => $element) {
    $options[$element_name] = isset($element['#title']) ? $element['#title'] : $element_name;
  }
  return $options;
}