You are here

function multiversion_field_info_alter in Multiversion 8

Same name and namespace in other branches
  1. 8.2 multiversion.module \multiversion_field_info_alter()

Implements hook_field_info_alter().

File

./multiversion.module, line 232

Code

function multiversion_field_info_alter(&$info) {
  if (\Drupal::state()
    ->get('multiversion_uninstalling', FALSE)) {
    return;
  }
  $info['uuid']['class'] = '\\Drupal\\multiversion\\Field\\UuidItem';
  $info['entity_reference']['class'] = '\\Drupal\\multiversion\\EntityReferenceItem';
  $info['file']['class'] = '\\Drupal\\multiversion\\FileItem';
  $info['image']['class'] = '\\Drupal\\multiversion\\ImageItem';
  if (isset($info['entity_reference_revisions'])) {
    $info['entity_reference_revisions']['class'] = '\\Drupal\\multiversion\\EntityReferenceRevisionsItem';
  }
  if (\Drupal::moduleHandler()
    ->moduleExists('pathauto')) {
    $info['path']['list_class'] = MultiversionFieldItemList::class;
  }
}