You are here

class AddressFormatSubscriber in Open Social 8

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

Class AddressFormatSubscriber.

@package Drupal\social_group\EventSubscriber

Hierarchy

  • class \Drupal\social_group\EventSubscriber\AddressFormatSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of AddressFormatSubscriber

1 string reference to 'AddressFormatSubscriber'
social_group.services.yml in modules/social_features/social_group/social_group.services.yml
modules/social_features/social_group/social_group.services.yml
1 service uses AddressFormatSubscriber
social_group.address_format_subscriber in modules/social_features/social_group/social_group.services.yml
Drupal\social_group\EventSubscriber\AddressFormatSubscriber

File

modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php, line 13

Namespace

Drupal\social_group\EventSubscriber
View source
class AddressFormatSubscriber implements EventSubscriberInterface {

  /**
   * Get the subscribed events.
   *
   * @return mixed
   *   Returns the subscribed events.
   */
  public static function getSubscribedEvents() {
    $events[AddressEvents::ADDRESS_FORMAT][] = [
      'onGetDefinition',
      0,
    ];
    return $events;
  }

  /**
   * The onGetDefinition function.
   */
  public function onGetDefinition($event) {
    $definition = $event
      ->getDefinition();

    // This makes all address fields optional for all entity types on site.
    // We can't set empty array because of check in AddressFormat.php, line 128.
    $definition['required_fields'] = [
      'givenName',
    ];
    $event
      ->setDefinition($definition);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AddressFormatSubscriber::getSubscribedEvents public static function Get the subscribed events.
AddressFormatSubscriber::onGetDefinition public function The onGetDefinition function.