4be887b29c3797ea85b82c57e932818fe38c0dff
[yaffs-website] / web / modules / contrib / devel / tests / modules / devel_entity_test / devel_entity_test.module
1 <?php
2
3 /**
4  * @file
5  * Test module for the entity API providing several entity types for testing.
6  */
7
8 /**
9  * Implements hook_entity_view_mode_info_alter().
10  */
11 function devel_entity_test_entity_view_mode_info_alter(&$view_modes) {
12   $entity_info = \Drupal::entityTypeManager()->getDefinitions();
13   foreach ($entity_info as $entity_type => $info) {
14     if ($entity_info[$entity_type]->getProvider() == 'devel_entity_test_canonical' && !isset($view_modes[$entity_type])) {
15       $view_modes[$entity_type] = array(
16         'full' => array(
17           'label' => t('Full object'),
18           'status' => TRUE,
19           'cache' => TRUE,
20         ),
21         'teaser' => array(
22           'label' => t('Teaser'),
23           'status' => TRUE,
24           'cache' => TRUE,
25         ),
26       );
27     }
28   }
29 }