Returns the config processor for a given configuration definition.
\Drupal\Core\TypedData\TraversableTypedDataInterface $definition: The field type.
\Drupal\tmgmt_config\ConfigProcessorInterface The config processor for this configuration definition.
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);
}