You are here

class MediaSettingsOverride in Media Download 1.0.x

Same name and namespace in other branches
  1. 1.2.x src/MediaSettingsOverride.php \Drupal\media_download\MediaSettingsOverride
  2. 1.1.x src/MediaSettingsOverride.php \Drupal\media_download\MediaSettingsOverride

Overrides the Media module's settings to forcibly enable standalone URL.

Copyright (C) 2021 Library Solutions, LLC (et al.).

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Hierarchy

Expanded class hierarchy of MediaSettingsOverride

1 string reference to 'MediaSettingsOverride'
media_download.services.yml in ./media_download.services.yml
media_download.services.yml
1 service uses MediaSettingsOverride
media_download.media_settings_override in ./media_download.services.yml
Drupal\media_download\MediaSettingsOverride

File

src/MediaSettingsOverride.php, line 19

Namespace

Drupal\media_download
View source
class MediaSettingsOverride implements ConfigFactoryOverrideInterface {

  /**
   * {@inheritdoc}
   */
  public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
    return NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheSuffix() {
    return self::CLASS;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheableMetadata($name) {
    return new CacheableMetadata();
  }

  /**
   * {@inheritdoc}
   */
  public function loadOverrides($names) {
    $overrides = [];
    if (in_array('media.settings', $names)) {
      $overrides['media.settings']['standalone_url'] = TRUE;
    }
    return $overrides;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MediaSettingsOverride::createConfigObject public function Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface::createConfigObject
MediaSettingsOverride::getCacheableMetadata public function Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface::getCacheableMetadata
MediaSettingsOverride::getCacheSuffix public function The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface::getCacheSuffix
MediaSettingsOverride::loadOverrides public function Returns config overrides. Overrides ConfigFactoryOverrideInterface::loadOverrides