function FieldTypePluginManager::processDefinition

Same name 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()
  3. 11.x core/lib/Drupal/Core/Field/FieldTypePluginManager.php \Drupal\Core\Field\FieldTypePluginManager::processDefinition()

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');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.