class DbUpdateNegotiator in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/system/src/Theme/DbUpdateNegotiator.php \Drupal\system\Theme\DbUpdateNegotiator
Sets the active theme for the database update pages.
Hierarchy
- class \Drupal\system\Theme\DbUpdateNegotiator implements ThemeNegotiatorInterface
Expanded class hierarchy of DbUpdateNegotiator
1 string reference to 'DbUpdateNegotiator'
- system.services.yml in core/
modules/ system/ system.services.yml - core/modules/system/system.services.yml
1 service uses DbUpdateNegotiator
- theme.negotiator.system.db_update in core/
modules/ system/ system.services.yml - Drupal\system\Theme\DbUpdateNegotiator
File
- core/
modules/ system/ src/ Theme/ DbUpdateNegotiator.php, line 18 - Contains \Drupal\system\Theme\DbUpdateNegotiator.
Namespace
Drupal\system\ThemeView source
class DbUpdateNegotiator implements ThemeNegotiatorInterface {
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a DbUpdateNegotiator.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
return $route_match
->getRouteName() == 'system.db_update';
}
/**
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
$custom_theme = Settings::get('maintenance_theme', 'seven');
if (!$custom_theme) {
$config = $this->configFactory
->get('system.theme');
$custom_theme = $config
->get('default');
}
return $custom_theme;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DbUpdateNegotiator:: |
protected | property | The config factory. | |
DbUpdateNegotiator:: |
public | function |
Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface:: |
|
DbUpdateNegotiator:: |
public | function |
Determine the active theme for the request. Overrides ThemeNegotiatorInterface:: |
|
DbUpdateNegotiator:: |
public | function | Constructs a DbUpdateNegotiator. |