You are here

public static function WebformElementHelper::removeProperties in Webform 6.x

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

Remove all properties from a render element.

Parameters

array $element: A render element.

Return value

array A render element with no properties.

2 calls to WebformElementHelper::removeProperties()
Webform::setElementPropertiesRecursive in src/Entity/Webform.php
Set element properties.
WebformEntitySettingsFormForm::save in src/EntitySettings/WebformEntitySettingsFormForm.php
Form submission handler for the 'save' action.

File

src/Utility/WebformElementHelper.php, line 291

Class

WebformElementHelper
Helper class webform element methods.

Namespace

Drupal\webform\Utility

Code

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