You are here

function social_event_an_enroll_uninstall in Open Social 8.9

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install \social_event_an_enroll_uninstall()
  2. 10.0.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install \social_event_an_enroll_uninstall()
  3. 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install \social_event_an_enroll_uninstall()
  4. 10.2.x modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install \social_event_an_enroll_uninstall()

Implements hook_uninstall().

File

modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.install, line 26
Install, update functions for the social_event_an_enroll module.

Code

function social_event_an_enroll_uninstall() {
  $moduleHandler = \Drupal::service('module_handler');

  // Delete the email field is social_event_invite is not enabled.
  // Todo:: is there a way to get field dependencies instead of manual?
  if (!$moduleHandler
    ->moduleExists('social_event_invite')) {
    $field = FieldConfig::loadByName('event_enrollment', 'event_enrollment', 'field_email');
    if ($field) {
      $field
        ->delete();
    }
  }
}