function EntityTypeInfo::fieldInfoAlter

Same name and namespace in other branches
  1. 9 core/modules/workspaces/src/EntityTypeInfo.php \Drupal\workspaces\EntityTypeInfo::fieldInfoAlter()
  2. 8.9.x core/modules/workspaces/src/EntityTypeInfo.php \Drupal\workspaces\EntityTypeInfo::fieldInfoAlter()
  3. 11.x 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 109

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

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