You are here

public function TypeProcessorPluginManager::getInstanceByFieldType in Content Synchronizer 3.x

Same name and namespace in other branches
  1. 8.2 src/Processors/Type/TypeProcessorPluginManager.php \Drupal\content_synchronizer\Processors\Type\TypeProcessorPluginManager::getInstanceByFieldType()
  2. 8 src/Processors/Type/TypeProcessorPluginManager.php \Drupal\content_synchronizer\Processors\Type\TypeProcessorPluginManager::getInstanceByFieldType()

Return the plugin by field type.

File

src/Processors/Type/TypeProcessorPluginManager.php, line 41

Class

TypeProcessorPluginManager
The type processor manager.

Namespace

Drupal\content_synchronizer\Processors\Type

Code

public function getInstanceByFieldType($fieldType) {
  foreach ($this
    ->getDefinitions() as $pluginId => $definition) {
    if ($definition['fieldType'] == $fieldType) {
      return self::createInstance($pluginId, []);
    }
  }
  return new DefaultTypeProcessor();
}