SocialLikeConfigOverride.php in Open Social 10.1.x
Same filename and directory in other branches
- 8.9 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 8 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 8.2 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 8.3 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 8.4 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 8.5 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 8.6 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 8.7 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 8.8 modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 10.3.x modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 10.0.x modules/social_features/social_like/src/SocialLikeConfigOverride.php
- 10.2.x modules/social_features/social_like/src/SocialLikeConfigOverride.php
Namespace
Drupal\social_likeFile
modules/social_features/social_like/src/SocialLikeConfigOverride.phpView source
<?php
namespace Drupal\social_like;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
use Drupal\Core\Config\StorageInterface;
/**
* Class SocialLikeConfigOverride.
*
* Example configuration override.
*
* @package Drupal\social_like
*/
class SocialLikeConfigOverride implements ConfigFactoryOverrideInterface {
/**
* Returns config overrides.
*/
public function loadOverrides($names) {
$overrides = [];
// Override post photo default.
$config_names = [
'core.entity_view_display.post.photo.activity',
'core.entity_view_display.post.photo.default',
];
foreach ($config_names as $config_name) {
if (in_array($config_name, $names)) {
$overrides[$config_name] = [
'content' => [
'like_and_dislike' => [
'weight' => 2,
'settings' => [],
'third_party_settings' => [],
],
],
];
}
}
return $overrides;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'SocialLikeConfigOverride';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Classes
Name | Description |
---|---|
SocialLikeConfigOverride | Class SocialLikeConfigOverride. |