You are here

public function DefaultUserReferenceHandler::getHandlerSettings in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Plugin/cms_content_sync/field_handler/DefaultUserReferenceHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultUserReferenceHandler::getHandlerSettings()
  2. 2.0.x src/Plugin/cms_content_sync/field_handler/DefaultUserReferenceHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultUserReferenceHandler::getHandlerSettings()

Get the handler settings.

Return the actual form elements for any additional settings for this handler.

Parameters

array $current_values: The current values that the user set, if any

string $type:: One of 'pull', 'push', 'both'

Return value

array

Overrides EntityReferenceHandlerBase::getHandlerSettings

File

src/Plugin/cms_content_sync/field_handler/DefaultUserReferenceHandler.php, line 43

Class

DefaultUserReferenceHandler
Providing a minimalistic implementation for any field type.

Namespace

Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler

Code

public function getHandlerSettings($current_values, $type = 'both') {
  return [
    'identification' => [
      '#type' => 'select',
      '#title' => 'Identification',
      '#options' => [
        self::IDENTIFICATION_EMAIL => 'Mail',
        self::IDENTIFICATION_NAME => 'Name',
        self::IDENTIFICATION_SYNC_USER => 'Sync User',
      ],
      '#default_value' => $current_values['identification'] ?? self::IDENTIFICATION_EMAIL,
    ],
  ];
}