You are here

public function SocialBookConfigOverride::loadOverrides in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  2. 8.2 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  3. 8.3 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  4. 8.4 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  5. 8.5 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  6. 8.6 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  7. 8.7 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  8. 8.8 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  9. 10.3.x modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  10. 10.0.x modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  11. 10.1.x modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()
  12. 10.2.x modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride::loadOverrides()

Load overrides.

Overrides ConfigFactoryOverrideInterface::loadOverrides

File

modules/social_features/social_book/src/SocialBookConfigOverride.php, line 20

Class

SocialBookConfigOverride
Class SocialBookConfigOverride.

Namespace

Drupal\social_book

Code

public function loadOverrides($names) {
  $overrides = [];

  // Set hero title block for book content type.
  $config_names = [
    'block.block.socialbase_pagetitleblock',
    'block.block.socialblue_pagetitleblock',
  ];
  foreach ($config_names as $config_name) {
    if (in_array($config_name, $names)) {
      $config = \Drupal::service('config.factory')
        ->getEditable($config_name);
      $bundles = $config
        ->get('visibility.node_type.bundles');
      $bundles['book'] = 'book';
      $overrides[$config_name] = [
        'visibility' => [
          'node_type' => [
            'bundles' => $bundles,
          ],
        ],
      ];
    }
  }
  return $overrides;
}