function EntityTypeInfo::fieldInfoAlter

Same name in this branch
  1. 11.x core/modules/workspaces/src/EntityTypeInfo.php \Drupal\workspaces\EntityTypeInfo::fieldInfoAlter()
Same name 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. 10 core/modules/workspaces/src/EntityTypeInfo.php \Drupal\workspaces\EntityTypeInfo::fieldInfoAlter()

Implements hook_field_info_alter().

File

core/modules/workspaces/src/Hook/EntityTypeInfo.php, line 95

Class

EntityTypeInfo
Defines a class for reacting to entity type information hooks.

Namespace

Drupal\workspaces\Hook

Code

public function fieldInfoAlter(array &$definitions) : void {
    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.