Upgraded imagemagick and manually altered pdf to image module to handle changes....
[yaffs-website] / web / modules / contrib / media_entity / media_entity.module
1 <?php
2
3 /**
4  * @file
5  * Provides media entities.
6  */
7
8 // This empty file needs to be here so that drush commands that automatically
9 // include .module files on enabled modules don't complain.
10
11 use Drupal\Core\Config\Entity\ConfigEntityType;
12 use Drupal\Core\Entity\ContentEntityType;
13 use Drupal\media_entity\Media;
14 use Drupal\media_entity\MediaBundle;
15
16 /**
17  * Implements hook_entity_type_build().
18  */
19 function media_entity_entity_type_build(array &$entity_types) {
20   if (!\Drupal::moduleHandler()->moduleExists('media')) {
21     $entity_types['media'] = new ContentEntityType([
22       'id' => 'media',
23       'provider' => 'media_entity',
24       'class' => Media::class,
25       'base_table' => 'media',
26       'data_table' => 'media_field_data',
27       'revision_table' => 'media_revision',
28       'revision_data_table' => 'media_field_revision',
29       'translatable' => TRUE,
30       'entity_keys' => [
31         'id' => 'mid',
32         'revision' => 'vid',
33         'bundle' => 'bundle',
34         'label' => 'name',
35         'langcode' => 'langcode',
36         'uuid' => 'uuid',
37         'published' => 'status',
38       ],
39       'revision_metadata_keys' => [
40         'revision_user' => 'revision_user',
41         'revision_created' => 'revision_created',
42         'revision_log_message' => 'revision_log_message',
43       ],
44       'bundle_entity_type' => 'media_bundle',
45     ]);
46     $entity_types['media_bundle'] = new ConfigEntityType([
47       'id' => 'media_bundle',
48       'provider' => 'media_entity',
49       'class' => MediaBundle::class,
50       'bundle_of' => 'media',
51       'entity_keys' => [
52         'id' => 'id',
53         'label' => 'label',
54       ],
55     ]);
56   }
57 }