You are here

class SocialPostPhotoAlbumConfigOverride in Open Social 10.3.x

Same name and namespace in other branches
  1. 10.0.x modules/social_features/social_post/modules/social_post_album/src/SocialPostPhotoAlbumConfigOverride.php \Drupal\social_post_album\SocialPostPhotoAlbumConfigOverride
  2. 10.1.x modules/social_features/social_post/modules/social_post_album/src/SocialPostPhotoAlbumConfigOverride.php \Drupal\social_post_album\SocialPostPhotoAlbumConfigOverride
  3. 10.2.x modules/social_features/social_post/modules/social_post_album/src/SocialPostPhotoAlbumConfigOverride.php \Drupal\social_post_album\SocialPostPhotoAlbumConfigOverride

Provides an overridden elements.

@package Drupal\social_post_album

Hierarchy

Expanded class hierarchy of SocialPostPhotoAlbumConfigOverride

2 string references to 'SocialPostPhotoAlbumConfigOverride'
SocialPostPhotoAlbumConfigOverride::getCacheSuffix in modules/social_features/social_post/modules/social_post_album/src/SocialPostPhotoAlbumConfigOverride.php
The string to append to the configuration static cache name.
social_post_album.services.yml in modules/social_features/social_post/modules/social_post_album/social_post_album.services.yml
modules/social_features/social_post/modules/social_post_album/social_post_album.services.yml
1 service uses SocialPostPhotoAlbumConfigOverride
social_post_album.override in modules/social_features/social_post/modules/social_post_album/social_post_album.services.yml
Drupal\social_post_album\SocialPostPhotoAlbumConfigOverride

File

modules/social_features/social_post/modules/social_post_album/src/SocialPostPhotoAlbumConfigOverride.php, line 14

Namespace

Drupal\social_post_album
View source
class SocialPostPhotoAlbumConfigOverride implements ConfigFactoryOverrideInterface {

  /**
   * Field widget or formatter type per configuration.
   */
  const TYPES = [
    'core.entity_form_display.post.photo.default' => 'social_post_album_image',
    'core.entity_view_display.post.photo.activity' => 'album_image',
  ];

  /**
   * {@inheritdoc}
   */
  public function loadOverrides($names) {
    $overrides = [];
    foreach (self::TYPES as $config_name => $type) {
      if (in_array($config_name, $names)) {
        $overrides[$config_name]['content']['field_post_image']['type'] = $type;
      }
    }
    return $overrides;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheSuffix() {
    return 'SocialPostPhotoAlbumConfigOverride';
  }

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

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

}

Members

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