You are here

protected function ConfigSource::getConfigProcessor in Translation Management Tool 8

Returns the config processor for a given configuration definition.

Parameters

\Drupal\Core\TypedData\TraversableTypedDataInterface $definition: The field type.

Return value

\Drupal\tmgmt_config\ConfigProcessorInterface The config processor for this configuration definition.

2 calls to ConfigSource::getConfigProcessor()
ConfigSource::getData in sources/tmgmt_config/src/Plugin/tmgmt/Source/ConfigSource.php
Implements TMGMTEntitySourcePluginController::getData().
ConfigSource::saveTranslation in sources/tmgmt_config/src/Plugin/tmgmt/Source/ConfigSource.php
Saves a translation.

File

sources/tmgmt_config/src/Plugin/tmgmt/Source/ConfigSource.php, line 235

Class

ConfigSource
Content entity source plugin controller.

Namespace

Drupal\tmgmt_config\Plugin\tmgmt\Source

Code

protected function getConfigProcessor(TraversableTypedDataInterface $definition) {
  $class = DefaultConfigProcessor::class;
  $data_definition = $definition
    ->getDataDefinition();
  if (method_exists($data_definition, 'toArray')) {
    $array_definition = $data_definition
      ->toArray();
    if (!empty($array_definition['tmgmt_config_processor'])) {
      $class = $array_definition['tmgmt_config_processor'];
    }
  }
  return \Drupal::service('class_resolver')
    ->getInstanceFromDefinition($class);
}