You are here

public static function WebformElementHelper::getProperties in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Utility/WebformElementHelper.php \Drupal\webform\Utility\WebformElementHelper::getProperties()

Get an associative array containing a render element's properties.

Parameters

array $element: A render element.

Return value

array An associative array containing a render element's properties.

3 calls to WebformElementHelper::getProperties()
Webform::initElementsRecursive in src/Entity/Webform.php
Initialize webform elements into a flatten array.
WebformElementHelper::getFlattened in src/Utility/WebformElementHelper.php
Flatten a nested array of elements.
WebformEntitySettingsFormForm::form in src/EntitySettings/WebformEntitySettingsFormForm.php
Gets the actual form array to be built.

File

src/Utility/WebformElementHelper.php, line 272

Class

WebformElementHelper
Helper class webform element methods.

Namespace

Drupal\webform\Utility

Code

public static function getProperties(array $element) {
  $properties = [];
  foreach ($element as $key => $value) {
    if (static::property($key)) {
      $properties[$key] = $value;
    }
  }
  return $properties;
}