You are here

public function Mp3playerDeleteForm::submitForm in MP3 Player 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

src/Form/Mp3playerDeleteForm.php, line 90
Contains \Drupal\mp3player\Form\ExampleForm.

Class

Mp3playerDeleteForm
Implements Mp3playerDeleteForm.

Namespace

Drupal\mp3player\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  db_delete('mp3player_players')
    ->condition('pid', $form_state
    ->getValues()['pid'])
    ->execute();
  $form_state
    ->setRedirect('mp3player.player_list');
}