You are here

protected static function YamlFormElementHelper::isIgnoredProperty in YAML Form 8

Determine if an element's property should be ignored.

Subelement properties are delimited using __.

Parameters

string $property: A property name.

Return value

bool TRUE is the property should be ignored.

See also

\Drupal\yamlform\Element\YamlFormSelectOther

\Drupal\yamlform\Element\YamlFormCompositeBase::processYamlFormComposite

2 calls to YamlFormElementHelper::isIgnoredProperty()
YamlFormElementHelper::getIgnoredProperties in src/Utility/YamlFormElementHelper.php
Get ignored properties from a form element.
YamlFormElementHelper::removeIgnoredProperties in src/Utility/YamlFormElementHelper.php
Remove ignored properties from an element.

File

src/Utility/YamlFormElementHelper.php, line 185

Class

YamlFormElementHelper
Helper class form element methods.

Namespace

Drupal\yamlform\Utility

Code

protected static function isIgnoredProperty($property) {

  // Build cached ignored properties regular expression.
  if (!isset(self::$ignoredPropertiesRegExp)) {
    self::$ignoredPropertiesRegExp = '/__(' . implode('|', array_keys(YamlFormArrayHelper::removePrefix(self::$ignoredProperties))) . ')$/';
  }
  if (isset(self::$ignoredProperties[$property])) {
    return TRUE;
  }
  elseif (strpos($property, '__') !== FALSE && preg_match(self::$ignoredPropertiesRegExp, $property)) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}