You are here

function ds_entity_type_alter in Display Suite 8.2

Same name and namespace in other branches
  1. 8.4 ds.module \ds_entity_type_alter()
  2. 8.3 ds.module \ds_entity_type_alter()

Implements hook_entity_type_alter().

File

./ds.module, line 951
Display Suite core functions.

Code

function ds_entity_type_alter(array &$entity_types) {

  /* @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
  foreach ($entity_types as $entity_type) {
    $base_table = $entity_type
      ->getBaseTable();
    if ($entity_type
      ->get('field_ui_base_route') && !empty($base_table)) {
      if ($entity_type
        ->hasLinkTemplate('canonical')) {
        $entity_type
          ->setLinkTemplate('display', $entity_type
          ->getLinkTemplate('canonical') . '/manage_display');
      }
    }
  }
}