You are here

function registration_delete_confirm_submit in Entity Registration 8

Same name and namespace in other branches
  1. 8.2 includes/registration.forms.inc \registration_delete_confirm_submit()
  2. 7.2 includes/registration.forms.inc \registration_delete_confirm_submit()
  3. 7 includes/registration.forms.inc \registration_delete_confirm_submit()

Execute node deletion.

File

includes/registration.forms.inc, line 346
Form definitions and callbacks for Registration.

Code

function registration_delete_confirm_submit($form, &$form_state) {
  if ($form_state['values']['confirm']) {
    $registration = $form_state['values']['registration'];
    registration_delete_multiple(array(
      $registration->registration_id,
    ));
    \Drupal::logger('registration')
      ->notice('Registration %id deleted.', array(
      '%id' => $registration->registration_id,
    ));
    drupal_set_message(t('Registration %id has been deleted.', array(
      '%id' => $registration->registration_id,
    )));
    $wrapper = entity_metadata_wrapper('registration', $registration);
    $host = $wrapper->entity
      ->value();
    $uri = entity_uri($registration->entity_type, $host);
    $form_state['redirect'] = $uri['path'];
  }
}