You are here

class EventAnEnrollOverride in Open Social 8.3

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  2. 8.4 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  3. 8.5 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  4. 8.6 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  5. 8.7 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  6. 8.8 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  7. 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  8. 10.0.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  9. 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride
  10. 10.2.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php \Drupal\social_event_an_enroll\EventAnEnrollOverride

Class EventAnEnrollOverride.

Override event form.

@package Drupal\social_event_an_enroll

Hierarchy

Expanded class hierarchy of EventAnEnrollOverride

2 string references to 'EventAnEnrollOverride'
EventAnEnrollOverride::getCacheSuffix in modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php
The string to append to the configuration static cache name.
social_event_an_enroll.services.yml in modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.services.yml
modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.services.yml
1 service uses EventAnEnrollOverride
social_event_an_enroll.overrider in modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.services.yml
\Drupal\social_event_an_enroll\EventAnEnrollOverride

File

modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollOverride.php, line 16

Namespace

Drupal\social_event_an_enroll
View source
class EventAnEnrollOverride implements ConfigFactoryOverrideInterface {

  /**
   * Returns config overrides.
   */
  public function loadOverrides($names) {
    $overrides = [];
    $config_factory = \Drupal::service('config.factory');

    // Add field_event_an_enroll to event form.
    $config_name = 'core.entity_form_display.node.event.default';
    if (in_array($config_name, $names)) {
      $config = $config_factory
        ->getEditable($config_name);
      $children = $config
        ->get('third_party_settings.field_group.group_event_visibility.children');
      $children[] = 'field_event_an_enroll';
      $content = $config
        ->get('content');
      $content['field_event_an_enroll'] = [
        'weight' => 100,
        'settings' => [
          'display_label' => TRUE,
        ],
        'third_party_settings' => [],
        'type' => 'boolean_checkbox',
        'region' => 'content',
      ];
      $overrides[$config_name] = [
        'third_party_settings' => [
          'field_group' => [
            'group_event_visibility' => [
              'children' => $children,
            ],
          ],
        ],
        'content' => $content,
      ];
    }
    return $overrides;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheSuffix() {
    return 'EventAnEnrollOverride';
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheableMetadata($name) {
    return new CacheableMetadata();
  }

  /**
   * {@inheritdoc}
   */
  public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
    return NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EventAnEnrollOverride::createConfigObject public function Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface::createConfigObject
EventAnEnrollOverride::getCacheableMetadata public function Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface::getCacheableMetadata
EventAnEnrollOverride::getCacheSuffix public function The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface::getCacheSuffix
EventAnEnrollOverride::loadOverrides public function Returns config overrides. Overrides ConfigFactoryOverrideInterface::loadOverrides