You are here

public function SingleNestedEnhancer::getSettingsForm in JSON:API Extras 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/jsonapi/FieldEnhancer/SingleNestedEnhancer.php \Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer\SingleNestedEnhancer::getSettingsForm()
  2. 8.2 src/Plugin/jsonapi/FieldEnhancer/SingleNestedEnhancer.php \Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer\SingleNestedEnhancer::getSettingsForm()

Get a form element to render the settings.

Parameters

array $resource_field_info: The resource field info.

Return value

array The form element array.

Overrides ResourceFieldEnhancerBase::getSettingsForm

File

src/Plugin/jsonapi/FieldEnhancer/SingleNestedEnhancer.php, line 75

Class

SingleNestedEnhancer
Perform additional manipulations to date fields.

Namespace

Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer

Code

public function getSettingsForm(array $resource_field_info) {
  $settings = empty($resource_field_info['enhancer']['settings']) ? $this
    ->getConfiguration() : $resource_field_info['enhancer']['settings'];
  return [
    'path' => [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Path'),
      '#description' => $this
        ->t('A dot separated path to extract the sub-property.'),
      '#default_value' => $settings['path'],
    ],
  ];
}