You are here

lightning_media_twitter.install in Lightning Media 8.3

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;

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

/**
 * 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();
}

/**
 * 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 Creates the media_browser form display.
lightning_media_twitter_update_8002 Creates the thumbnail display for tweets.
lightning_media_twitter_update_dependencies Implements hook_update_dependencies().