You are here

public static function YamlFormElementHelper::getIgnoredProperties in YAML Form 8

Get ignored properties from a form element.

Parameters

array $element: A form element.

Return value

array An array of ignored properties.

3 calls to YamlFormElementHelper::getIgnoredProperties()
YamlFormElementBase::validateConfigurationForm in src/YamlFormElementBase.php
Form validation handler.
YamlFormElementHelperTest::testGetIgnoredProperties in tests/src/Unit/YamlFormElementHelperTest.php
Tests YamlFormElementHelper::GetIgnoredProperties().
YamlFormEntityElementsValidator::validateProperties in src/YamlFormEntityElementsValidator.php
Validate that elements are not using ignored properties.

File

src/Utility/YamlFormElementHelper.php, line 138

Class

YamlFormElementHelper
Helper class form element methods.

Namespace

Drupal\yamlform\Utility

Code

public static function getIgnoredProperties(array $element) {
  $ignored_properties = [];
  foreach ($element as $key => $value) {
    if (Element::property($key)) {
      if (self::isIgnoredProperty($key)) {
        $ignored_properties[$key] = $key;
      }
    }
    elseif (is_array($value)) {
      $ignored_properties += self::getIgnoredProperties($value);
    }
  }
  return $ignored_properties;
}