You are here

public function EntityTypeInfo::fieldInfoAlter in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/workspaces/src/EntityTypeInfo.php \Drupal\workspaces\EntityTypeInfo::fieldInfoAlter()
  2. 10 core/modules/workspaces/src/EntityTypeInfo.php \Drupal\workspaces\EntityTypeInfo::fieldInfoAlter()

Alters field plugin definitions.

Parameters

array[] $definitions: An array of field plugin definitions.

See also

hook_field_info_alter()

File

core/modules/workspaces/src/EntityTypeInfo.php, line 103

Class

EntityTypeInfo
Manipulates entity type information.

Namespace

Drupal\workspaces

Code

public function fieldInfoAlter(&$definitions) {
  if (isset($definitions['entity_reference'])) {
    $definitions['entity_reference']['constraints']['EntityReferenceSupportedNewEntities'] = [];
  }

  // Allow path aliases to be changed in workspace-specific pending revisions.
  if (isset($definitions['path'])) {
    unset($definitions['path']['constraints']['PathAlias']);
  }
}