You are here

public function FieldTypePluginManager::processDefinition in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldTypePluginManager.php \Drupal\Core\Field\FieldTypePluginManager::processDefinition()
  2. 10 core/lib/Drupal/Core/Field/FieldTypePluginManager.php \Drupal\Core\Field\FieldTypePluginManager::processDefinition()

Performs extra processing on plugin definitions.

By default we add defaults for the type to the definition. If a type has additional processing logic they can do that by replacing or extending the method.

Overrides DefaultPluginManager::processDefinition

File

core/lib/Drupal/Core/Field/FieldTypePluginManager.php, line 88

Class

FieldTypePluginManager
Plugin manager for 'field type' plugins.

Namespace

Drupal\Core\Field

Code

public function processDefinition(&$definition, $plugin_id) {
  parent::processDefinition($definition, $plugin_id);
  if (!isset($definition['list_class'])) {
    $definition['list_class'] = '\\Drupal\\Core\\Field\\FieldItemList';
  }

  // Ensure that every field type has a category.
  if (empty($definition['category'])) {
    $definition['category'] = $this
      ->t('General');
  }
}