class AddressFormatSubscriber in Open Social 8
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 8.2 modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 8.3 modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 8.4 modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 8.5 modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 8.6 modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 8.7 modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 8.8 modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 10.3.x modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 10.0.x modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 10.1.x modules/social_features/social_group/src/EventSubscriber/AddressFormatSubscriber.php \Drupal\social_group\EventSubscriber\AddressFormatSubscriber
- 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\EventSubscriberView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AddressFormatSubscriber:: |
public static | function | Get the subscribed events. | |
AddressFormatSubscriber:: |
public | function | The onGetDefinition function. |