You are here

CommentSelectForm.php in WordPress Migrate 8.3

File

wordpress_migrate_ui/src/Form/CommentSelectForm.php
View source
<?php

namespace Drupal\wordpress_migrate_ui\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Simple wizard step form.
 */
class CommentSelectForm extends FormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'wordpress_migrate_comment_select_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {

    // Start clean in case we came here via Previous.
    $cached_values = $form_state
      ->getTemporaryValue('wizard');
    unset($cached_values['comment']);
    $form_state
      ->setTemporaryValue('wizard', $cached_values);
    $form['overview'] = [
      '#markup' => $this
        ->t('WordPress blogs contain comments.'),
    ];
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function validateForm(array &$form, FormStateInterface $form_state) {
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $cached_values = $form_state
      ->getTemporaryValue('wizard');
    $form_state
      ->setTemporaryValue('wizard', $cached_values);
  }

}

Classes

Namesort descending Description
CommentSelectForm Simple wizard step form.