You are here

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

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

Determine if element or sub-element has property and value.

Parameters

array $elements: An array of elements.

string $property: An element property.

mixed|null $value: An element value.

Return value

bool TRUE if element or sub-element has property and value.

1 call to WebformElementHelper::hasProperty()
WebformElementHelperTest::testHasProperty in tests/src/Unit/Utility/WebformElementHelperTest.php
Tests WebformElementHelper::hasProperty().

File

src/Utility/WebformElementHelper.php, line 259

Class

WebformElementHelper
Helper class webform element methods.

Namespace

Drupal\webform\Utility

Code

public static function hasProperty(array $elements, $property, $value = NULL) {
  return static::hasProperties($elements, [
    $property => $value,
  ]);
}