class GetSettingsFromCoreSettings in Acquia Content Hub 8.2
Gets the ContentHub Server settings from Drupal's settings.
Hierarchy
- class \Drupal\acquia_contenthub\EventSubscriber\GetSettings\GetSettingsFromCoreSettings implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of GetSettingsFromCoreSettings
1 file declares its use of GetSettingsFromCoreSettings
1 string reference to 'GetSettingsFromCoreSettings'
1 service uses GetSettingsFromCoreSettings
File
- src/
EventSubscriber/ GetSettings/ GetSettingsFromCoreSettings.php, line 14
Namespace
Drupal\acquia_contenthub\EventSubscriber\GetSettingsView source
class GetSettingsFromCoreSettings implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[AcquiaContentHubEvents::GET_SETTINGS][] = [
'onGetSettings',
1000,
];
return $events;
}
/**
* Gets a prebuilt Settings object from Drupal's settings file.
*
* @param \Drupal\acquia_contenthub\Event\AcquiaContentHubSettingsEvent $event
* The dispatched event.
*
* @see \Acquia\ContentHubClient\Settings
*/
public function onGetSettings(AcquiaContentHubSettingsEvent $event) {
$settings = CoreSettings::get('acquia_contenthub.settings');
if ($settings && $settings instanceof ContentHubClientSettings) {
$event
->setSettings($settings);
$event
->setProvider('core_settings');
$event
->stopPropagation();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GetSettingsFromCoreSettings:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
GetSettingsFromCoreSettings:: |
public | function | Gets a prebuilt Settings object from Drupal's settings file. |