You are here

lightning_media_twitter.install in Lightning Media 8.4

Contains install and update routines for Lightning Media Twitter.

File

modules/lightning_media_twitter/lightning_media_twitter.install
View source
<?php

/**
 * @file
 * Contains install and update routines for Lightning Media Twitter.
 */
use Drupal\lightning_core\ConfigHelper as Config;

/**
 * Removed in Lightning Media 4.0.
 *
 * Formerly created the media_browser form display.
 */
function lightning_media_twitter_update_8001() {
}

/**
 * Creates the thumbnail display for tweets.
 */
function lightning_media_twitter_update_8002() {
  Config::forModule('lightning_media_twitter')
    ->getEntity('entity_view_display', 'media.tweet.thumbnail')
    ->save();
}

/**
 * Creates the media_library form display for tweets.
 */
function lightning_media_twitter_update_8003() {
  Config::forModule('lightning_media_twitter')
    ->getEntity('entity_form_display', 'media.tweet.media_library')
    ->save();
}

/**
 * Implements hook_update_dependencies().
 */
function lightning_media_twitter_update_dependencies() {
  return [
    'lightning_media_twitter' => [
      // 8002 depends on the thumbnail view mode, which is created by
      // lightning_media 8015.
      8002 => [
        'lightning_media' => 8015,
      ],
    ],
  ];
}

Functions

Namesort descending Description
lightning_media_twitter_update_8001 Removed in Lightning Media 4.0.
lightning_media_twitter_update_8002 Creates the thumbnail display for tweets.
lightning_media_twitter_update_8003 Creates the media_library form display for tweets.
lightning_media_twitter_update_dependencies Implements hook_update_dependencies().