You are here

protected function ConditionalFieldEditForm::setFieldProperty in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x src/Form/ConditionalFieldEditForm.php \Drupal\conditional_fields\Form\ConditionalFieldEditForm::setFieldProperty()

Set render array property and all child elements.

1 call to ConditionalFieldEditForm::setFieldProperty()
ConditionalFieldEditForm::getDummyField in src/Form/ConditionalFieldEditForm.php
Creates dummy field instance.

File

src/Form/ConditionalFieldEditForm.php, line 576

Class

ConditionalFieldEditForm
Class ConditionalFieldEditForm.

Namespace

Drupal\conditional_fields\Form

Code

protected function setFieldProperty(&$field, $property, $value) {
  $elements = Element::children($field);
  if (isset($elements) && count($elements) > 0) {
    foreach ($elements as $element) {
      $field[$element][$property] = $value;
      $this
        ->setFieldProperty($field[$element], $property, $value);
    }
  }
}