You are here

protected function Pattern::getContext in UI Patterns 8

Get source field plugin context.

Return value

array Context array.

1 call to Pattern::getContext()
Pattern::alterForm in modules/ui_patterns_ds/src/Plugin/DsFieldTemplate/Pattern.php

File

modules/ui_patterns_ds/src/Plugin/DsFieldTemplate/Pattern.php, line 127

Class

Pattern
Plugin for the expert field template.

Namespace

Drupal\ui_patterns_ds\Plugin\DsFieldTemplate

Code

protected function getContext() {
  $fields = $this->parameters
    ->get('fields');
  $field_name = $this
    ->getCurrentField();
  return [
    'field_name' => $field_name,
    'field_settings' => $fields[$field_name],
    'entity_type' => $this->parameters
      ->get('ds_entity_type'),
    'bundle' => $this->parameters
      ->get('ds_bundle'),
    'view_mode' => $this->parameters
      ->get('ds_view_mode'),
  ];
}