video_embed_media.module in Video Embed Field 8
The module file for video_embed_media.
File
modules/video_embed_media/video_embed_media.moduleView source
<?php
/**
* @file
* The module file for video_embed_media.
*/
use Drupal\media_entity\Entity\MediaBundle;
use Drupal\video_embed_media\Plugin\MediaEntity\Type\VideoEmbedField;
/**
* Implements hook_ENTITY_TYPE_insert() for media_bundle.
*/
function video_embed_media_media_bundle_insert(MediaBundle $media_bundle) {
if ($media_bundle->type === 'video_embed_field' && !$media_bundle
->isSyncing() && empty($media_bundle
->getTypeConfiguration()['source_field'])) {
VideoEmbedField::createVideoEmbedField($media_bundle
->id());
}
}
Functions
Name | Description |
---|---|
video_embed_media_media_bundle_insert | Implements hook_ENTITY_TYPE_insert() for media_bundle. |