SocialLandingPageConfigOverride.php in Open Social 8
Same filename and directory in other branches
- 8.9 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 8.2 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 8.3 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 8.4 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 8.5 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 8.6 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 8.7 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 8.8 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 10.3.x modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 10.0.x modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 10.1.x modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
- 10.2.x modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
Namespace
Drupal\social_landing_pageFile
modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.phpView source
<?php
namespace Drupal\social_landing_page;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
/**
* Class SocialLandingPageConfigOverride.
*
* Example configuration override.
*
* @package Drupal\social_landing_page
*/
class SocialLandingPageConfigOverride implements ConfigFactoryOverrideInterface {
/**
* Load overrides.
*/
public function loadOverrides($names) {
$overrides = [];
// Set hero title block for book content type.
$config_names = [
'search_api.index.social_all',
'search_api.index.social_content',
];
foreach ($config_names as $config_name) {
if (in_array($config_name, $names)) {
$config = \Drupal::service('config.factory')
->getEditable($config_name);
$bundles = $config
->get('datasource_settings.entity:node.bundles.selected');
$bundles[] = 'landing_page';
$overrides[$config_name] = [
'datasource_settings' => [
'entity:node' => [
'bundles' => [
'selected' => $bundles,
],
],
],
];
}
}
return $overrides;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'SocialLandingPageConfigOverride';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Classes
Name![]() |
Description |
---|---|
SocialLandingPageConfigOverride | Class SocialLandingPageConfigOverride. |