function EntityReferenceItem::fieldSettingsAjaxProcessElement

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcessElement()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcessElement()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::fieldSettingsAjaxProcessElement()

Adds the field settings to AJAX form elements.

See also

static::fieldSettingsAjaxProcess()

1 call to EntityReferenceItem::fieldSettingsAjaxProcessElement()
EntityReferenceItem::fieldSettingsAjaxProcess in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
Render API callback: Processes the field settings form.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php, line 652

Class

EntityReferenceItem
Defines the 'entity_reference' entity field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public static function fieldSettingsAjaxProcessElement(&$element, $main_form) {
    if (!empty($element['#ajax'])) {
        $element['#ajax'] = [
            'callback' => [
                static::class,
                'settingsAjax',
            ],
            'wrapper' => $main_form['#id'],
            'element' => $main_form['#array_parents'],
        ];
    }
    foreach (Element::children($element) as $key) {
        static::fieldSettingsAjaxProcessElement($element[$key], $main_form);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.